Navidrome is a lightweight, self-hosted music streaming server that allows you to manage and enjoy your music library from anywhere. As an open-source alternative to proprietary services, it puts you in complete control of your data while offering a sleek, user-friendly interface. In this guide, weβll walk you through installing, configuring, and managing Navidrome, including setup with Docker or manual installation, reverse proxy configuration, logging, backups, updates, and advanced usage.
Installing Navidrome
π¦ Docker/Docker Compose Setup
Using Docker is one of the easiest and most efficient ways to deploy Navidrome. Below is a docker-compose.yml
file you can use to set up the app.
version: '3.8'
services:
navidrome:
image: navidrome/navidrome:latest
container_name: navidrome
ports:
- 4533:4533 # Exposing the default Navidrome port
volumes:
- ./data:/data # Persistent data storage
- ./music:/music # Folder containing your music library
environment:
- ND_LOGLEVEL=info
- ND_SCANINTERVAL=1h
- ND_SESSIONTIMEOUT=24h
restart: unless-stopped
Run the following commands in the same directory as your docker-compose.yml
file:
docker-compose up -d
This command will download the latest Navidrome image, create the required containers, and start the application. Access Navidrome at http://<your-server-ip>:4533
.
π Manual Installation
For users who prefer manual installation, follow these steps to install Navidrome on a Linux server:
- Install dependencies:
sudo apt update
sudo apt install -y wget unzip
- Download the latest Navidrome binary:
wget https://github.com/navidrome/navidrome/releases/latest/download/navidrome-linux-amd64.zip
- Extract the binary and move it to a global location:
unzip navidrome-linux-amd64.zip
sudo mv navidrome /usr/local/bin/
- Create a systemd service for Navidrome:
sudo nano /etc/systemd/system/navidrome.service
Add the following content:
[Unit]
Description=Navidrome Music Server
After=network.target
[Service]
ExecStart=/usr/local/bin/navidrome
Restart=always
User=navidrome
Group=navidrome
WorkingDirectory=/var/lib/navidrome
Environment="ND_LOGLEVEL=info" "ND_SCANINTERVAL=1h"
[Install]
WantedBy=multi-user.target
- Reload systemd and start the service:
sudo systemctl daemon-reload
sudo systemctl start navidrome
sudo systemctl enable navidrome
Access Navidrome at http://<your-server-ip>:4533
.
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
To serve Navidrome through a custom domain and make it accessible via HTTPS, set up Nginx as a reverse proxy.
- Install Nginx:
sudo apt install -y nginx
- Create a new server block for your domain:
sudo nano /etc/nginx/sites-available/navidrome
Add the following configuration:
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://localhost:4533;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
- Enable the configuration and restart Nginx:
sudo ln -s /etc/nginx/sites-available/navidrome /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
π SSL/TLS Setup
Secure your Navidrome instance with Let's Encrypt SSL certificates.
- Install Certbot:
sudo apt install -y certbot python3-certbot-nginx
- Obtain and apply an SSL certificate:
sudo certbot --nginx -d yourdomain.com
- Test automatic renewal:
sudo certbot renew --dry-run
π οΈ Testing and Reloading Nginx
Check for syntax errors and reload Nginx after any changes:
sudo nginx -t
sudo systemctl reload nginx
Logging and Debugging Navidrome
ποΈ Enabling Debug Logs
For detailed debugging, enable debug-level logging in Navidrome. Add the following to your environment variables:
ND_LOGLEVEL=debug
Then restart the Navidrome service:
sudo systemctl restart navidrome
π Viewing Logs
Access logs depending on your installation method:
- Docker:
docker logs navidrome
- Systemd:
journalctl -u navidrome -f
π οΈ Troubleshooting Common Issues
If Navidrome is not starting or behaving as expected:
- Check for port conflicts:
sudo netstat -tuln | grep 4533
- Ensure correct permissions for volumes:
sudo chown -R navidrome:navidrome /var/lib/navidrome
π€ Exporting Logs
Send logs to an external system for advanced analysis using tools like Fluentd or Filebeat. Example for Filebeat:
sudo filebeat setup --input-type log --path /var/lib/navidrome/logs/
sudo systemctl start filebeat
Backup and Restore
ποΈ File-Based Backups
Backup Navidromeβs configuration and music library:
tar -czvf navidrome-backup.tar.gz /var/lib/navidrome /music
π Database Backups
If you use an external database, export it:
mysqldump -u username -p navidrome > navidrome_db_backup.sql
π Automated Backup Scripts
Set up a cron job for periodic backups:
crontab -e
Add the following line for daily backups:
0 2 * * * tar -czvf ~/navidrome-backup-$(date +\%F).tar.gz /var/lib/navidrome /music
Updating and Upgrading Navidrome
β¬οΈ Updating Docker Images
Update to the latest Navidrome image:
docker-compose pull
docker-compose up -d
π οΈ Manual Updates
Download and replace the latest binary:
wget https://github.com/navidrome/navidrome/releases/latest/download/navidrome-linux-amd64.zip
unzip -o navidrome-linux-amd64.zip -d /usr/local/bin/
sudo systemctl restart navidrome
π Checking for Updates
Check the latest release on the Navidrome GitHub page.
Leveraging Navidromeβs Unique Features
π§ Enabling APIs
Enable Navidromeβs REST API for integrating with external apps by confirming the API is accessible at:
curl http://<your-server-ip>:4533/api
Use the API with tools like Python:
import requests
response = requests.get('http://<your-server-ip>:4533/api')
print(response.json())
π Advanced Configurations
Customize Navidrome further by editing the configuration file at /var/lib/navidrome/navidrome.toml
. Example:
BaseURL = "/music"
ScanInterval = "30m"
SessionTimeout = "48h"
Restart the service to apply changes:
sudo systemctl restart navidrome
Wrapping Up
Navidrome empowers you to stream and manage your music library with complete control over your data. From installing and securing your server to enabling APIs and customizing features, the steps in this guide provide everything you need to set up and optimize Navidrome. Start implementing these examples today and enjoy the full benefits of this powerful self-hosted music server!