How To Install Airsonic Media Server On an Ubuntu 18.04 VPS or Dedicated Server

How To Install Airsonic Media Server On an Ubuntu 18.04 VPS or Dedicated Server


Airsonic is an open-source media server that allows you to fully access your music and share it with colleagues or even enjoy listening to your favorite playlist at any place. This free self-hosted media streamer is based on Java language, and built to deal with a large collection of music and is the ultimate solution for MP3 streaming. Airsonic is compatible with any video or audio file format as long as they are streaming comfortably over HyperText Transfer protocol including FLAX, WMA, APE, and many more. In this article, we will take you through the process of installing Airsonic on your Ubuntu 18.04 server. Similarly, we will also install Airsonic with the help of the reliable.WAR package, activate the service, then configure Nginx server as a reverse proxy for this installation.

Before You Start

With these items in place, let’s get started.

Step 1 –
Installing Java OpenJDK

Being a java language based app, Airsonic needs to use Java for the installation process. This process requires the installation of the latest  OpenJDK series. First, start by installing Java OpenJDK. You can get it from Webupd8team; the official PPA repository. Remember to install the common packages of the software then include the PPA repository for Java OpenJDK. You can do this by running the following command:

$ sudo apt install software-properties-common apt-transport-https -y
$ sudo add-apt-repository ppa:webupd8team/java -y

The next step involves the installation of the Java OpenJDK.

$ sudo apt installoracle-java8-installer -y

The system should automatically install Java OpenJDK application on your Ubuntu 18.04 server. Once you’re done, execute the command below to check the current version of Java OpenJDK:

$ java -version

This will give you the output below:

Javaversion "1.8.0_181"
Java (TM) SERuntimeEnvironment (build 1.8.0_181-b13)
JavaHotSpot (TM) 64-BitserverVM (build 25.181-b13, mixmode)

Step 2 –
Installing and Configuring Airsonic

Airsonic can be installed in several different packages. In this article, we shall explore our stand-alone installation using WAR packages. Start by creating another user with the name ‘airsonic,’ then create a directory named ‘/opt/airsonic.’ For this process, run the following command:

$ sudo useradd airsonic
$ sudo mkdir -p /opt/airsonic

Open the newly created directory; /opt/airsonic and search then download the .WAR package for Airsonic using wget as shown below:

$ cd /opt/airsonic
$ wget

Change the name of this directory to ‘airsonic’ user as well as the group.

$ sudo chown -R airsonic:airsonic /opt/airsonic

After that, the .WAR package for the Airsonic installation should be downloaded. The next thing creating a new file for Airsonic. To do so, go to ‘/etc/systemd/system’ directory then create a service file named airsonic.service

$ sudo nano /etc/systemd/system

Edit and include the following lines for the Airsonic configuration as shown below:

Description=Airsonic Media Server

          -jar ${JAVA_JAR} $JAVA_ARGS


Now save and close the file. Restart your system and go to ‘/etc/default’ directory then create a default file for airsonic.

$ sudo systemctl daemon-reload
$ sudo nano /etc/default/airsonic

Add the default configuration file below for 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:

Now, save and close the file. Restart your Airsonic service then set it to start on boot time.

$ sudo systemctl start airsonic
$ sudo systemctl enable airsonic

Now the installation process for airsonic alone is done. Use a netstat command to check its status.

$ netstat -plntu

At this point, the default Airsonic service will listen to port ‘8080’ that is used by Airsonic’s Java service.

Step 3 –
Generating A New SSL Lets Encrypt Cert

As aforementioned, we will install Airsonic via the HTTP connections for Nginx web server, but you have to choose a domain name of your choice. Now, we will try to create the SSL certificate using Letsencrypt. First, execute the command below to install the required Letsencrypt tool:

$ sudo apt install letsencrypt -y

Once the tool is installed, you can now create a new SSL certificate for your domain name using the following command. Remember to replace the value “domian name” with your precise domain name:

$ certbot certonly --standalone -domain name

When you run the command above, you’ll be prompted to provide your email address to receive notifications. Type ‘A’ for the TOS agreement on Letsencrypt to show that you agree with the terms then type ‘N’ for No for the shared email address. Once you’re done, you will receive a congratulatory message to show that your certificate has been successfully generated and saved in the /etc/letsencrypt/live/domain directory.

Step 4 –
Installing and Configuring Nginx Reverse Proxy

Now we shall start installing the Nginx server then configure it on port 8080 on Airsonic software as a reverse proxy. To start the Nginx installation, run the apt command below:

$sudo apt install nginx -y

Now, open the ‘/etc/nginx’ directory then create a new virtual host file named ‘airsonic.’ cd /etc/nginx/

$ sudo nano  sites-available/airsonic

Add the following lines in the configuration:

server {
    listen [::]:80;
    # enforce https
    return301 https://$server_name$request_uri;

server {
    listen              443 ssl;
    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;

    location /airsonic {
      proxy_set_header X-Real-IP         $remote_addr;
      proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto https;
      proxy_set_header X-Forwarded-Host  $http_host;
      proxy_set_header Host              $http_host;
      proxy_max_temp_file_size           0;
      proxy_pass               ;
      proxy_redirect                     http:// https://;

Now, save and close the file. The next step is to activate the already created ‘airsonic host file then start testing the configuration:

$ sudo ln -s /etc/nginx/sites-available/airsonic /etc/nginx/sites-enabled/
nginx -t

Confirm that there are no errors, then restart the Nginx service and set it to start at boot time.

$ sudo systemctl restart nginx
$ sudo systemctl enable nginx

By this point, the Nginx service is successfully operating as the reverse proxy for Airsonic. It should listen to port 8080 under a secure https connection. To confirm this, use the netstat command as shown below:

$ netstat -plntu

Step 5 –
Configuring Uncomplicated Firewall (UFW) Firewall

Here, we shall work on Ubuntu UFW firewall. Start by accessing the Uncomplicated Firewall by opening the SSH, HTTPS, and HTTP service using the commands below:

$ sudo ufw allow ssh
$ sudo ufw allow http
$ sudo ufw allow https

Go ahead and activate your ufw firewall.

$ sudo ufw enable

Now, enter ‘y’ for Yes then click Enter to complete the activation.

Step 6 –
Verifying The Installation

For this step, open your favorite web browser, then enter the URL for Airsonic installation.


You should see the login page for Airsonic. How To Install Airsonic Media Server on Ubuntu 18.04 LTS Now, use the default username and password which is ‘admin,’ to log into your Airsonic dashboard. Once you access the dashboard, you can access the intuitive Airsonic dashboard. The next step is to change the default password. To do so, select Change administrator password. How To Install Airsonic Media Server on Ubuntu 18.04 LTS Choose admin user then mark the Change password checkbox before typing your new admin password. Once you’re done, select Save. How To Install Airsonic Media Server on Ubuntu 18.04 LTS Now, Airsonic initial admin password has been successfully changed. The next step is to create media folders. Setting up Medial Folders. Go to your server’s terminal shell and create media folders then label them as ‘airsonic’ user.

$ suod mkdir -p /var/music
$ sudo chown -R airsonic:airsonic /var/music

On Airsonic dashboard, select Settings then locate the Media folders icon. How To Install Airsonic Media Server on Ubuntu 18.04 LTS Ensure that your default Music media folders are activated, before pressing the Save button. Next, locate the User section then choose admin user and check the Music media folder box as shown below: How To Install Airsonic Media Server on Ubuntu 18.04 LTS Now the Music media file is enabled. Now the user can be able to access these media files. Here is how the Airsonic dashboard should look like after making the changes. How To Install Airsonic Media Server on Ubuntu 18.04 LTS


That is it! Airsonic has been successfully installed on your Ubuntu 18.04 server.

Check out these top 3 VPS services:

£3.16 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
  • Support
  • Features
  • Reliability
  • Pricing
£2.36 /mo
Starting price
Visit Hostinger
Rating based on expert review
  • User Friendly
  • Support
  • Features
  • Reliability
  • Pricing
Liquid Web
£3.95 /mo
Starting price
Visit Liquid Web
Rating based on expert review
  • User Friendly
  • Support
  • Features
  • Reliability
  • Pricing

How to Install Own Cloud On an an Ubuntu 18.04 Dedicated Server or VPS

You can create your own self-hosted cloud storage services by installing the ope
3 min read
Idan Cohen
Idan Cohen
Marketing Expert

How to Install a Let’s Encrypt Certificate on your Ubuntu 18.04 Dedicated Server or VPS

If you are hosting your website on a VPS server running Ubuntu 18.04, we will sh
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester

How to Enable Two-Factor Authentication on an Ubuntu 18.04 VPS or Dedicated Server

This guide will show you how you enable two-factor authentication to improve the
4 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Harden Your Apache Web Server on an Ubuntu 18.04 Dedicated Server or VPS

Apache as one of the most popular web servers is susceptible to hacking attacks.
3 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top