How to Setup Airsonic on Ubuntu 16.04


Step 1: Install java:

For Airsonic to work, you should have Java installed…. To do that, run the commands below… The easiest way to install Oracle Java JDK 8 on Ubuntu is via a third party PPA… To add that PPA, run the commands below…

sudo add-apt-repository ppa:webupd8team/java

Now update:

sudo apt update

Now install Java:

sudo apt install oracle-java8-installer

Accept the license agreement.

Set Oracle JDK8 as default, to do that, install the oracle-java8-set-default package. This will automatically set the JAVA env variable.

Sudo apt install oracle-java8-set-default

Now that JAVA is installed, run the commands below to set its home directory:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" JAVA_HOME=/usr/lib/jvm/java-8-oracle export JAVA_HOME

After that run the command below:

source /etc/environment

When you run echo $JAVA_HOME  you should now see Java home directory:

Step 2: Download and Configure Airsonic

Now that Java is installed, run the commands below to create Airsonic home directory and download Airsonic archived package:

Create home directory:

sudo mkdir -p /opt/airsonic

Now go into the airsonic folder:

cd /opt/airsonic

Now download airsonic.war file:

sudo wget

After that, creat Airsonic user and give the user access to the /opt/airsonic directory

sudo useradd airsonic

Than give the user access to that directory

sudo chown -R airsonic:airsonic /opt/airsonic

Next, create Airsonic systemd service… Run the commands below

sudo nano /etc/systemd/system/airsonic.service

Then copy the content below into the file and save it…

Description=Airsonic Media Server

ExecStart=/usr/bin/java \
-Dairsonic.home=${AIRSONIC_HOME} \
-Dserver.context-path=${CONTEXT_PATH} \
-Dserver.port=${PORT} \


Save the file and exit… After saving the file, run the commands below to reload systemd

sudo systemctl daemon-reload

After that, run the commands below to create airsonc default config file…

sudo nano /etc/default/airsonic


# Set the location of the standalone war to use

# Set any java opts separated by spaces

# Set a different location for the airsonic home.
# If this path is /opt/libresonic or even contains “libresonic”,
# the data from a previous libresonic can be used as is (i.e. without
# renaming,db/libresonic*, etc

# Change the port to listen on

# Change the path that is listened to on

# Add any java args. These are different than JAVA_OPTS in that
# they are passed directly to the program. The default is empty:

# Note that there are several settings for spring boot, not explicitly listed
# here, but can be used in either JAVA_OPTS or JAVA_ARGS. The full list
# can be found here:
# For example to set debug across the board:

# Or to change the IP address that is listened to:


Start Airsonic service

sudo systemctl start airsonic
sudo systemctl enable airsonic