1. Home
  2. Linux

How To Set Up Your Own Music Streaming Server On Linux With Subsonic

There are many different types of music services out there today. Even on Linux, users can choose from Amazon Prime Music, Google Music, Spotify, and others. However, all of these services have one thing in common; Linux users don’t get the freedom to use the music players they want, or have the freedom to modify how the music service works.

Not to worry! There’s a music service that exists that anyone can easily run on their own Linux PC or server. It allows for unlimited music storage, internet radio support, and even can manage podcasts. So, how do you install it?

Installing Java

Subsonic is a Java application. In order for it to work on Linux (whether you’re running this on a Linux server or Desktop/Laptop) the Java runtime needs to be installed. Start off by opening a terminal window, and entering the following command:

Ubuntu

sudo apt install openjdk-8-jre

Arch Linux

sudo pacman -S jre8-openjdk

Fedora

sudo dnf install java-1.8.0-openjdk.x86_64

OpenSUSE

SUSE has a 1-click install package for several versions of Java for Subsonic. The version being covered in this guide is the Open Java Development Kit Runtime Environment, version 8.

Go to this page here, and click on it to install it. However, understand that there are many versions of Java on this operating system. If you’re having issues using version 8, consider uninstalling it, and trying out some of the other 1-click package versions of Java here.

Debian

sudo apt-get install openjdk-8-jre

Please note, though this guide focuses on using version 8 of the Java runtime environment, it is not the newest version. The reason for this is so that users looking to install Subsonic can do so with any version, not just the latest one.

Don’t want to use version 8 with your Subsonic music server? Feel free to search your Linux PC for a newer version. Subsonic doesn’t have any issues (as far as we know) in using newer versions of the Java Runtime Environment. Additionally, it is also possible to go to Oracle, and use the official Java runtime environment for Linux as well.

Installing Subsonic

Subsonic is packaged up on the developer’s website. Those using Open SUSE, or Fedora (and Redhat based servers like CentOS etc) should go to this download page, and download the Redhat version of Subsonic.

Those on Ubuntu, Debian, Linux Mint, Elementary OS and etc: head over to this download page, and get the Debian package file for Subsonic.

Arch Linux users, download and build this AUR package, and Subsonic will install on the system.

For the Redhat and Debian package: double-click on the file downloaded from the Subsonic website, and run it. It will open up with Gnome Software, the Ubuntu software center (or whatever software installer your version of Linux runs). Click the installation button, enter the password and Subsonic will install to your PC.

Configuring Subsonic

The Subsonic Media Server is installed, but that isn’t enough. The server software has a background program that allows it to interact with networks, devices, and other important components. Open a terminal, and use systemd to both start the Subsonic background process, and enable it at boot as well.

First, start the background process.

sudo systemctl start subsonic

Then, enable the background process at boot.

sudo systemctl start subsonic

Are you a Debian user? Some versions of Debian do not use the systemd start system. Start the service with this command instead: sudo service subsonic start

Then, open this configuration file with the Nano text editor, find “root” and change it to your username. Save the file with Ctrl + O.

With the background program running, and fully enabled, open up a web browser and visit the following url: http://localhost:4040

Those running Subsonic on a server should visit the server’s IP address via a web browser instead. This information is easily found via the router, or by using the ifconfig command.

Adding Music to Subsonic

Place music on the the Linux PC (or server), and keep in mind where the files are. For example, if you installed the Subsonic media server on an Ubuntu Laptop or Desktop, place your music in /home/username/Music, or somewhere similar, with the file manager.

Then, inside of the Subsonic interface, click the “Settings” icon in the sidebar, and enter where the music is stored in subsonic as shown in the image below.

Then, click “save”, followed by “Scan media folders now”. This will save the settings, and also go out and find all music, and then add them to subsonic.

To listen to music, click “Home”, and browse through the music added.

Note: server users should place their music files in /var/music/.

Other Subsonic features

Subsonic can do other things besides stream music over the internet and the local network. It is possible to add podcasts, or internet radio stations.

Add a podcast by clicking the “podcast” tab. Add the RSS feed from the podcast(s) you want listen to. From here, it will be possible to have the Subsonic server download podcasts, and play them back over the mobile app, and through the web interface.

Adding radio stations happens roughly the same way. Go to the sidebar, and click internet radio. Then just add the URL of the internet radio stream.

Subsonic Mobile Apps

Your Subsonic can be accessed from Android or iOS. Just download one of the many subsonic mobile apps. Many developers have made Subsonic apps. If you’re not a fan of the official mobile app for Subsonic, try out some of the alternative apps linked. No doubt there’s a solution for everyone.

Note: Subsonic can be used free of charge, but has a premium mode that allows users to get more advanced features. Buy a one year license here.

Conclusion

Music streaming is very cool, but it is lame having to put faith in services to reliably deliver the content you want. With Subsonic, you rely on no one but the power of your Linux machine, and the size of your hard drives. For those who are a bit more tech savvy, this is a much better option.

Leave a comment