I setup Ampache streaming server a while back, and it's been breat, but I like to see what other software is out there, so thought I'd check out Airsonic.   I saw some good reviews on Reddit about it, and figured it would be a good one to do an install of.

I still have Airsonic setup, and it seems to work fine, but I'll be honest, I like the Ampache interface a bit better.  Now, I say that, but you should know that Airsonic is apparently coming out with a new interface, but as yet I don't know when.

Installation

What you Need for this Tutorial (we'll do this below)

  • Docker CE Installed on the Server Machine
  • Disk Space for your Music / Media on the machine
  • Optionally
    - A URL you can access the server from (e.g. airsonic.mymedia.org)
    - The Public IP of your Server (if you want to do the step above.
    - NginX Proxy Manager Setup and Ready to use for the URL

Step 1: Install Docker CE

In order to save typing, I'm going to link you to the page I always use for installing Docker CE.  I use Ubuntu 18.04, so if you're using a different distro, you should search for your distribution and version instruction.  The site is below.

How To Install and Use Docker on Ubuntu 18.04 | DigitalOcean
Docker is an application that simplifies the process of managing application processes in containers. In this tutorial, you’ll install and use Docker Community Edition (CE) on Ubuntu 18.04. You’ll install Docker itself, work with containers and images, and push an image to a Docker Repository.

Simply follow the commands in order, one by one.  And in about 2 minutes you'll have Docker installed and ready.

STep 2: Setup the Directories for AirSonic Docker Volumes

Airsonic can be run from a very simple docker command. It's great, and will let you check out Airsonic without any hassle, but if you stop the container, the data will be lost, and you'd essentially have to start over. We, therefore want to use docker volumes to help persist our data.

On your server pick a parent folder to start in, and create a new airsonic folder.  I did this in my home foder (`/home/brina`), but feel free to do this wherever you want.  

mkdir airsonic

Now, we need to make four folders inside the airsonic folder.  

  1. data
  2. playlists
  3. music
  4. podcasts

cd airsonic

mkdir data

mkdir music

mkdir playlists

mkdir podcasts

Great!  Now onto the final step to get Airsonic installed.

Pull down Airsonic from Docker and get it running.

Below, I'm going to put all of the commands, just note, you'll want to replace the text <your-user> with your actual username for the system.

docker run -v /home/<your-user>/airsonic/data:/airsonic/data -v /home/<your-user>/airsonic/music:/airsonic/music -v /home/<your-user>/airsonic/playlists:/airsonic/playlsts -v /home/<your-user>/airsonic/podcasts:/airsonic/podcasts -p 4040:4040 -d --restart=unless-stopped --name=airsonic airsonic/airsonic

Now, if you have not added your user to the docker group in your system, you may get an error. You can fix this 1 of 2 ways.

  1. use sudo in front of the whole command above.
  2. add your user to the docker group, then log out and back in.

You can add your user to the docker group with:

sudo usermod -a -G docker <your-user>

Post Installation

Now that Airsonic is installed, give it a couple of minutes, then go to your systems IP (Proviate or Public, whatever you can hit easily for now), and port 4040 (unless you changed it above).

for me it was http://192.168.7.125:4040

You should see the Airsonic initial login screen.  You should also see a short message below the login fields that tell you to login with admin / admin the first time.  After doing this, you should immediately change your admin password for the installation.

Make it Reachable through URL

If you are running NginX-Proxy-Manager, you can also make this site both accessible from the web, as well as SSL secured.

If you are interested in doing this, but haven't seen my tutorial on installing and setting up NginX-Proxy-Manager, I'll link it below.  It is worth your time if you intend to run any sites where you want a URL for the site.

Once you have NginX-Proxy-Manager (NPM) setup and running, you can add a new host to it.  Give your airsonic install a URL based on a domain you own, and point it to the IP of your docker0 network link.

In my case, it was 172.17.0.1.  Then I added port 4040.  Finally, I did enable websocket support.  Now, I simply save without making any other changes on the other tabs, adn just test it to make sure that url opens my site.

Info on tab 1:

  • URL: airsonic.routemehome.org     (I own routemehome.org, and I have a wildcard A record that will send all traffic for *.routemehome.org to my home Public IP address unliess an override A record for a URL is entered specifically).
  • docker0 IP:  172.17.0.1     (I found this using the command ifconfig, but you may need to use the newer command ip addr show.  I don't know why they changed it).
  • Port: 4040     (we set port 4040 in our docker run command above).

If everything is working on your test, go back to NPM and select to edit the host.

Now, on tab 2 in NPM, you want to enter the same url, in my case airsonic.routemehome.org.  Then, select https in the drop-down the same IP for docker0 (again in my case 172.17.0.1).  And finally, enter the same port 4040.  

Now, move to tab 3, and select to Request a New Certificate, then enable Force SSL, enter your email address (a valid email, as the Free Software Foundation won't spam you, and check that you accept the temrs.  

Click "Save" and be patient.  This will now have LetsENcrypt challenge your URL on port 80 (which is why we are setting all this up), and issue LetsENcrypt SSL certificates if everything works.

If you get no errors, and the pop-up window goes away, you should be set.

You should now be able tonavigate to your site using https, and again see the login screen.