Install Subsonic Streaming Media Server Ubuntu

subsonic-logoInstall Subsonic on Ubuntu for a streaming media server you can use to stream your videos and music outside your home. Subsonic is similar to Madsonic, written in Java and supports multiple apps for enjoying your media on a variety of devices like Android, iOS, Windows and more. The most popular Android app is Subsonic which is also compatible with Madsonic. Note that you will need to pay for a license to transcode video, if you want to transcode video with a similar program use this Madsonic guide. This Subsonic tutorial was tested on Ubuntu 14.x and 15.x.

Pi Unit
Processor
RAM
RAM Bus
Network
WiFi
USB
SATA
Cost
Raspberry Pi 3
1.2 GHz ARMv8
Quad Core
1 GB DDR2
450 MHz
100 Mbit
Yes
4
No
$35
Raspberry Pi 2
900 MHz ARMv7
Quad Core
1 GB DDR2
450 MHz
100 Mbit
No
4
No
$35.00
Raspberry Pi
700 MHz ARMv6
Single Core
512 MB SDRAM
400 MHz
100 Mbit
No
4
No
$25
Banana Pi
1 GHz ARMv7
Dual Core
1 GB DDR3
432 MHz
Gigabit
No
2
Yes
$36.99
Banana Pi Pro
1 GHz ARMv7
Dual Core
1 GB DDR3
432 MHz
Gigabit
Yes
2
Yes
$45.00

Install Subsonic Streaming Media Server Ubuntu

First install Java on Ubuntu

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
sudo apt-get update
sudo apt-get install oracle-java8-installer -y

Download the latest Subsonic debian package which works on Ubuntu. If this doesn't work then let me know in the comments and I'll fix the mini script.

If it does fail go here and click on Debian, a new page will pop up and right click subsonic-xxx.deb and use that URL instead of the bottom wget URL

SUBSONIC=$(wget -q http://www.subsonic.org/pages/download.jsp -O - | grep .deb | awk -F "[\"]" ' NR==1 {print $2}')
SUBSONICFILE=$(echo $SUBSONIC | awk 'match($0, /subsonic.+\.deb$/) {print substr($0, RSTART, RLENGTH)}')
cd /tmp
wget http://subsonic.org/download/$SUBSONICFILE -O subsonic.deb

Install Subsonic on Ubuntu and clean up afterwards

sudo dpkg -i subsonic.deb
rm subsonic.deb

Change the user Madsonic runs as (by default it's root)

sudo nano /etc/default/subsonic

Change SUBSONIC_USER to your main user (like htpcguides)

SUBSONIC_USER="htpcguides"

If you want to change the SUBSONIC port and memory adjust values in this line

SUBSONIC_ARGS="--init-memory=256 --max-memory=512"

If you want to limit memory and change the port (the default is 4040) or add https, then add these values to the uncommented line (the one without the #)

SUBSONIC_ARGS="--port=8080 --https-port=8443 --init-memory=256 --max-memory=512"

Ctrl+X, Y and Enter to save, you'll restart Subsonic after installing transcoding tools

Install Subsonic transcoding tools for Ubuntu, this will work on 14.x, 15.x and later as long as libav-tools exists

sudo apt-get install libav-tools xmp lame flac -y

Remove the links to the default Subsonic packages

sudo rm /var/subsonic/transcode/ffmpeg
sudo rm /var/subsonic/transcode/lame
sudo rm /var/subsonic/transcode/xmp
sudo rm /var/subsonic/transcode/flac

Subsonic uses ffmpeg so we are tricking the symlink into using avconv.

sudo ln -s /usr/bin/avconv /var/subsonic/transcode/ffmpeg
sudo ln -s /usr/bin/flac /var/subsonic/transcode/flac
sudo ln -s /usr/bin/xmp /var/subsonic/transcode/xmp
sudo ln -s /usr/bin/lame /var/subsonic/transcode/lame

Now you have installed Subsonic on Ubuntu and can begin configuring it and adding your media.