Subsonic is a powerful, web-based media server that allows you to stream your music collection from anywhere. Whether you’re at home, at work, or on the go, Subsonic gives you access to your entire music library through a web browser or mobile app. In this guide, we’ll walk you through the process of setting up Subsonic on a Linux system, specifically Ubuntu or Debian.
Installing Subsonic on Linux
Before we begin, make sure your system is up to date:
sudo apt update && sudo apt upgrade -y
Step 1: Install Java, which is required to run Subsonic:
sudo apt install openjdk-8-jre -y
Step 2: Download the latest Subsonic package:
wget https://s3-eu-west-1.amazonaws.com/subsonic-public/download/subsonic-6.1.6.deb
Step 3: Install the Subsonic package:
sudo dpkg -i subsonic-6.1.6.deb
sudo apt-get -f install
After installation, Subsonic should start automatically. You can access it by opening your web browser and navigating to http://localhost:4040
.
Configuring Subsonic
Now that Subsonic is installed, let’s configure it for optimal performance and security.
Setting Up Media Folders
Step 1: Log in to the Subsonic web interface using the default credentials (username: admin, password: admin).
Step 2: Navigate to Settings > Media folders.
Step 3: Click “Add folder” and specify the path to your music library. For example: /home/yourusername/Music
.
Step 4: Click “Save” and then “Scan media folders now” to index your music.
Changing the Default Password
For security reasons, it’s crucial to change the default admin password:
Step 1: Go to Settings > Users.
Step 2: Click on the “admin” user.
Step 3: Enter a new, strong password and click “Save”.
Enabling Transcoding
Transcoding allows Subsonic to convert music files on-the-fly to ensure compatibility with various devices and network conditions.
Step 1: Install FFmpeg, a powerful multimedia framework:
sudo apt install ffmpeg -y
Step 2: In the Subsonic web interface, go to Settings > Transcoding.
Step 3: Enable transcoding for the desired formats and adjust bitrates as needed.
Setting Up a Reverse Proxy
A reverse proxy can improve security and enable access to Subsonic using a custom domain with HTTPS. We’ll use Nginx for this example.
Step 1: Install Nginx:
sudo apt install nginx -y
Step 2: Create a new Nginx configuration file:
sudo nano /etc/nginx/sites-available/subsonic
Step 3: Add the following configuration, replacing yourdomain.com
with your actual domain:
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://localhost:4040;
proxy_set_header Host $host;
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 $scheme;
}
}
Step 4: Enable the configuration and restart Nginx:
sudo ln -s /etc/nginx/sites-available/subsonic /etc/nginx/sites-enabled/
sudo systemctl restart nginx
Securing Subsonic with HTTPS
To encrypt traffic between your device and the Subsonic server, let’s set up HTTPS using Let’s Encrypt.
Step 1: Install Certbot:
sudo apt install certbot python3-certbot-nginx -y
Step 2: Obtain and install an SSL certificate:
sudo certbot --nginx -d yourdomain.com
Follow the prompts to complete the process. Certbot will automatically update your Nginx configuration to use HTTPS.
Accessing Subsonic from Mobile Devices
Subsonic offers official apps for both Android and iOS, allowing you to stream your music on the go.
- For Android: Download “Subsonic” from the Google Play Store.
- For iOS: Download “play:Sub” from the App Store.
When setting up the app, use your domain name (e.g., https://yourdomain.com
) as the server address, and enter your Subsonic username and password.
With Subsonic set up on your Linux system, you now have a powerful, personal streaming service at your fingertips. Enjoy your music collection from anywhere, anytime, with the flexibility and control that Subsonic provides.