If you have a server with Memset then it probably has plenty of CPU cycles, bandwidth and hard disk space going spare and also love having your own music collection available to listen to anywhere then installing Subsonic is the perfect project for you.
Subsonic is a media streaming server application that is loaded onto a server and that is accessed with a web browser. Once that you upload your media collection onto the server then you will be able to stream your media collection to any browser that you happen to be using. Subsonic support all popular music and movie file formats and has many other features. In addition, the paid for Premium version supports streaming to apps on your phone so you will never to shuffle your media files around your devices again.
This guide will use a Debian 8 Jessie miniserver as the base for the installation. However, an Ubuntu miniserver will use the same commands if you prefer to use that distribution.
The only required package that must be installed before Subsonic is a Java Run Time environment commonly referred to as JRE. In order to begin the installation log into your server as root. Once you are logged JRE is installed with the following command:
apt-get update && apt-get upgrade apt-get install openjdk-7-jre-headless
We installed the headless version of JRE i.e.without local monitor support, as it's a server without a local monitor and the standard package installs many additional packages that are not needed here.
The Subsonic installation package now needs downloading and installing. The package is available from the Subsonic download page. We need the Debian / Ubuntu version.
There are two methods to get the file onto the server. It can either be downloaded t to your local computer and then upload it again to your server. Or it can be download directly to the server. This is done with the wget command run from the command line of the server. The following is the wget command with the URL to the latest installation file.
wget http://subsonic.org/download/subsonic-5.3.deb
Once the file has finished downloading it is installed with the following command executed from the same directory as the file:
dpkg -i subsonic-5.3.deb
Subsonic will get started as part of the installation, however, it will be running as the root user and needs some additional configuration. It must be stopped before its configuration is edited:
service subsonic stop
We will configure Subsonic to run as a normal user instead of root as it is a more secure configuration.
First we need to create the new user (subsonic):
adduser subsonic
You will need to enter a password when prompted (Memset has a secure password generator on the Memset site) You can hit enter to skip through the room number etc questions as they are not necessary.
Now the at the new user is created we will need to create a directory under subsonic's home directory to place the music into. And once it is created set the correct ownership:
mkdir /home/subsonic/Music chown subsonic:subsonic /home/subsonic/Music
Once that is done we need to configure subsonic to run as the new user and enable HTTPS connectivity. This is done by editing a configuration with the following command:
nano /etc/default/subsonic
And changing the line that reads:
SUBSONIC_USER=root
to
SUBSONIC_USER=subsonic
While we are editing that file, it will also be a good idea to enable HTTPS access to the server. This is done by adding “--https-port=4443” to the SUBSONIC_ARGS= line so that it looks like:
SUBSONIC_ARGS="--max-memory=150 --https-port=4443"
The port number 4443 is correct in the above configuration i.e. one additional 4 than normal. We are not able to use the standard port 443 for HTTPS access because only the root user is allowed to open a port lower than 1024 and we have configured Subsonic to run as a non-root user.
Now we need to upload some music into the Music folder we created earlier. I recommend using WinSCP as it securely logs into the server as the subsonic user account. Once you have downloaded and installed WinSCP you just need to set the hostname to your server, the port to 22, the user to be subsonic and the ‘’’File Protocol’’’ to ‘’’SFTP’’’:
Once you have logged in there will only the Music directory will be visible. You need to double click on that directory and upload your music there.
Subsonic works best if your music is arranged in directories that go: Artist -> Album -> songs. For example:
Johnny Cash At Fulsom Prison At San Quentin I Walk The Line I Walk the Line Bad News Folsom Prison Blues Give My Love to Rose Hey Porter
We now now need to log into the Subsonic interface and to complete the configuration. Subsonic first needs starting from the command line:
service subsonic start
You can log into SubSonic using either the IP address of your server, any domain name that resolves to it or to its Memset attributed hostname appending the HTTPS port we configured earlier using the following form of URL:
https://exampledomain.com:4443
The first time you visit subsonic via HTTPS you will receive a dire warning from your browser about the SSL certificate being invalid and/or self-signed. This is normal and happens because the certificate being used to create the encrypted session has not been purchased from a trusted signing authority as it was self-generated during the installation os subsonic. However, it will still work normally to encrypt your password and data.
When using Google Chrome you just need to hit ‘’’Advanced’’’ link then the ‘’’Proceed to’’’ link to get to the login page.
For Firefox you need to click ‘’’I understand the risks’’’ then the ‘’’Add Exception’’’ button and finally the ‘’’Confirm Security Exception’’’ button. In both cases, you will only see the error the first time. On subsequent visits, you will go straight to the login page without any warnings.
The first time you reach the login page it will look the following:
You will need to login using the default username and password:
Username: admin Password: admin
The first thing you will see when you log into Subsonic is the Getting Started page:
You need to hit the first link and change the admin password immediately.
The second link; ‘’’Set up media folders’’’, is where subsonic is configured to look for your music. Clicking on this link will take you to the following page:
You need to edit the ‘’’/var/music’’’ in the‘’’Folder’’’ field to ‘’’/home/subsonic/Music’’’ as this is the location we created earlier to hold the music.
Then click the ‘’’Save’’ button at the bottom of the page.
Finally, click the ‘’’Scan media folders now’’’ link to get the music indexed. Anytime you add more music to your server you should click that the scan media link to add it to subsonic.
The last job to do is to allow the admin user access to the music folder so they can play your music. To give them access click Setting -> Users and select the admin user from the ‘’’Select user’’’ drop down menu.
You simply need to check the box under the heading ‘’’Allow access to the media folders and next the Music folder and then hit ‘’’Save’’’.
You are now ready to start using Subsonic. You can browse your music collection by hitting the ‘’’Home’’’ button in the top navigation panel. Anytime you add more music you just need to hit the Scan media folders now button to get the new music loaded into Subsonic database.
Last updated 28 June 2017, 13:39 GMT