How to Self-Host Navidrome on a VPS (Complete Guide)
Navidrome is a self-hosted music server that allows you to stream your audio collection. With its simple interface and robust features, itโs a fantastic choice for those wanting to access their music libraries from anywhere. In this guide, we will walk through the steps to install Navidrome on a VPS using Docker, allowing developers and homelabbers to enjoy an efficient environment for self-hosting.
Choosing a VPS Provider
First, you need to choose a VPS provider. Below is a comparison of some popular providers that are well-suited for self-hosting applications like Navidrome.
| Provider | Price | CPU | RAM | Disk Space | Link |
|---|---|---|---|---|---|
| Contabo VPS | 5.99 EUR/mo | 4 vCPU | 8 GB | 200 GB SSD | Contabo |
| Hetzner Cloud | 4.15 EUR/mo | 1 vCPU | 2 GB | 20 GB SSD | Hetzner |
| DigitalOcean | 6 USD/mo | 1 vCPU | 1 GB | 25 GB SSD | DigitalOcean |
| Vultr | 6 USD/mo | 1 vCPU | 1 GB | 25 GB SSD | Vultr |
| Linode (Akamai Cloud) | 5 USD/mo | 1 vCPU | 2 GB | 50 GB SSD | Linode |
For most users, a basic plan with 2 GB RAM should be sufficient. Providers like Hetzner Cloud and Contabo offer excellent value for money, specifically geared towards projects like self-hosting.
Setting Up Your VPS
-
Create an Account and Deploy Your VPS: Choose a VPS provider and sign up. Deploy your server with Ubuntu 20.04 or later for optimal compatibility.
-
Connect to Your VPS: Use an SSH client (like PuTTY or the terminal on macOS/Linux) to connect to your VPS:
ssh root@your_vps_ip -
Initial Server Setup: After logging in, update your package list and upgrade your system:
apt update && apt upgrade -y -
Install Docker: Navidrome runs well in a Docker container. Install Docker by running:
apt install docker.io -y systemctl start docker systemctl enable docker -
Install Docker Compose: Docker Compose will help in orchestrating Navidrome and its dependencies:
apt install docker-compose -y
Installing Navidrome
-
Create a Directory for Navidrome: Create a directory to hold your Navidrome files:
mkdir -p ~/navidrome cd ~/navidrome -
Create a Docker Compose File: Create a
docker-compose.ymlfile with the following content:version: '3' services: navidrome: image: deluan/navidrome:latest restart: unless-stopped ports: - "4533:4533" volumes: - ./music:/music - ./data:/data environment: - ND_DATABASE="sqlite3" -
Run Navidrome: Use Docker Compose to start the Navidrome server:
docker-compose up -d -
Access Navidrome: Open your web browser and navigate to
http://your_vps_ip:4533. You should see the Navidrome interface. Set up your admin account and start uploading your music.
Configuring Your Navidrome
Adding Music
You can add music by placing your audio files into the music directory created earlier. Navigate back to your server and upload files:
scp your-music-file.mp3 root@your_vps_ip:~/navidrome/music/
Configuring Environment Variables
You can customize your Navidrome setup further by modifying the environment variables in the Docker Compose file. You might want to integrate with your existing audio libraries or adjust storage settings based on your usage.
FAQs
Can I run Navidrome alongside other applications on my VPS?
Yes. With the resource allocation from your VPS provider, you can run multiple applications simultaneously. Ensure that your VPS has adequate CPU and memory resources to handle concurrent workloads. You may want to scale your VPS plan depending on usage, especially if running resource-intensive applications.
What if I need an SSL certificate for Navidrome?
If you want to secure your Navidrome server with HTTPS, consider using a reverse proxy (like Nginx) along with Letโs Encrypt for obtaining free SSL certificates. This setup will require additional configuration but is essential for securing your data in transit.
How do I back up my Navidrome data?
Backing up your Navidrome data is straightforward. Ensure you regularly back up the data and music directories. You can use tools like rsync or automate the process with cron jobs to push backups to remote servers or cloud storage for disaster recovery.
Conclusion
Self-hosting Navidrome on a VPS allows you full control over your music library and enhances your homelab experience. By following this guide, you set up a cost-effective and powerful solution for streaming your music anytime, anywhere.
For a broader comparison of VPS options, check out our full VPS comparison. Enjoy your music streaming with Navidrome!