This guide will wallk you through the process of deploying Libresonic on FreeBSD either in a Jail on on the main system. The prerequisites are you have root access on your FreeBSD machine (or jail), the ip address of the machine (or jail) and the Libresonic war available at the [Libresonic github page](https://github.com/Libresonic/libresonic/releases)
If on FreeNAS create a standard jail in the web interface and enter the shell.
### 1. Install Tomcat
To run Libresonic we need a server to run it in. Log into your machine and then run these commands either as root or with sudo
#pkg install tomcat8 nano
Hit y on all prompts to complete installation of Tomcat
### 2.Configure Tomcat
Edit Tomcat's user configuration file with your favourite text editor. We installed nano in step 1.
Open a web browser and enter your servers IP address in the url bar followed by :8080 eg
10.0.0.10:8080
You should be greeted by the Apache Tomcat page. Click on the Manager App button on the right of the page and enter the username and password used in step 3. Default was username: admin and password: admin
Scroll down to Deploy and the subheading "WAR file to deploy" hit choose file and select the libresonic.war downloaded in the preamble. After selecting press the deploy button. Scroll up and press start. When the page refreshes a message "OK - Started application at context path /libresonic-v6.1.beta1" should be visible.
Log in. The default is username: admin password: admin
Follow the prompts on the web page to change the password. This will log you out. Please re-login with your new password
### 8. Set up media
If you are on FreeBSD in a jail, consult the documentation for your Jail Manager tool on how to pass through storage. If using FreeNAS please use the FreeNAS webui to pass through the dataset containing your music.
If you need mp3 support and most likely you will the process is more arduous as FreeBSD's ffmpeg doesn't contain mp3 support by default and must be configured and compiled by the user.
This will bring up a menu. Scroll down using arrow keys to "LAME" and hit the spacebar to enable it. Press enter to continue.
The ffmpeg source files will automatically be downloaded then you will be presented with an additional prompt to install documentation. I uncheck with spacebar then press enter to continue.