How To Install Navidrome on AlmaLinux 9
In today’s digital age, music streaming has become an essential part of our lives. Navidrome, a powerful music streaming server, allows users to access their music collections from anywhere using a modern web interface and compatible mobile apps for both iOS and Android devices. This guide will walk you through the step-by-step process of installing Navidrome on AlmaLinux 9, a stable and reliable operating system.
Introduction to Navidrome and AlmaLinux 9
Navidrome is designed to provide a seamless music streaming experience by making your music library accessible from any device with a web browser or compatible mobile app. It supports various formats and offers features like playlist management, album art, and more, making it a great alternative to other music streaming solutions like Subsonic and Airsonic.
AlmaLinux 9, on the other hand, is a community-driven Linux distribution known for its stability and continuity. It is an ideal choice for hosting services like Navidrome due to its robustness and ease of use.
Benefits of Using Navidrome
- Accessibility: Access your music library from anywhere.
- Compatibility: Works with both iOS and Android devices.
- Customization: Offers various configuration options for personalized use.
- Performance: Efficiently handles large music collections.
Prerequisites for Installation
Before installing Navidrome, ensure you have the following prerequisites in place:
- AlmaLinux 9 System: Ensure AlmaLinux 9 is installed and running on your server or virtual machine.
- Root Access: Have root access to the system for installing necessary packages and configuring settings.
- Docker Installation: Docker must be installed and running on AlmaLinux 9. If Docker is not already installed, follow the steps below to install it.
Installing Docker on AlmaLinux 9
If Docker is not installed, here’s how you can set it up:
- Update Your System:
sudo dnf update -y
- Add the Docker Repository:
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
- Install Docker Engine:
sudo dnf install docker-ce docker-ce-cli containerd.io
- Start and Enable Docker:
sudo systemctl start docker sudo systemctl enable docker
- Verify Docker Installation:
sudo docker run hello-world
Step 1: Install Nginx
Nginx will act as a reverse proxy for Navidrome, enhancing security and performance by handling incoming requests and routing them to the Navidrome server.
Installation Steps
- Open a Terminal: SSH into your AlmaLinux 9 system or open a terminal if you are working locally.
- Install Nginx:
sudo dnf install nginx -y
- Enable and Start Nginx:
sudo systemctl enable nginx sudo systemctl start nginx
- Verify Nginx Status:
sudo systemctl status nginx
Step 2: Enable Firewall Rules
AlmaLinux 9 uses firewalld
by default for managing firewall rules. You need to enable HTTP and HTTPS services to allow incoming traffic to your Navidrome server.
Steps to Enable Firewall Rules
- Enable HTTP and HTTPS Services:
sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https
- Reload Firewall Rules:
sudo firewall-cmd --reload
Step 3: Install Let’s Encrypt SSL Certificate
To secure your Navidrome installation with a free SSL certificate from Let’s Encrypt, follow these steps:
Steps to Install SSL Certificate
- Install Certbot:
sudo dnf install certbot python3-certbot-nginx -y
- Obtain SSL Certificate:
sudo certbot --nginx
Step 4: Configure Nginx Server Blocks
Configure Nginx to proxy requests to Navidrome by creating a server block.
Steps to Configure Nginx Server Blocks
- Create a New File: In
/etc/nginx/conf.d/
, create a new file namednavidrome.conf
. - Add Server Block 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; proxy_set_header X-Forwarded-Proto $scheme; } }
Replace
yourdomain.com
with your actual domain name. - Restart Nginx:
sudo systemctl restart nginx
Step 5: Enable Port 4533
Allow incoming traffic on port 4533 for Navidrome to function properly.
Steps to Enable Port 4533
- Add Firewall Rule:
sudo firewall-cmd --zone=public --permanent --add-port=4533/tcp
- Reload Firewall Rules:
sudo firewall-cmd --reload
Step 6: Install Navidrome with Docker
Use the Docker command to install Navidrome. This method ensures that Navidrome runs in a containerized environment, which is easy to manage and maintain.
Steps to Install Navidrome
- Run the Docker Command:
docker run -d \ --name navidrome \ --restart=unless-stopped \ --user $(id -u):$(id -g) \ -v /path/to/music:/music \ -v /path/to/data:/data \ -p 4533:4533 \ -e ND_LOGLEVEL=info \ deluan/navidrome:latest
Replace
/path/to/music
and/path/to/data
with the actual paths where your music library and data will be stored. - Access Navidrome Web Interface:
- Open a web browser and navigate to
https://your-server-ip:4533
to access the Navidrome web interface.
- Open a web browser and navigate to
Step 7: Add Music/Audio Files to Navidrome
To add music files to Navidrome, ensure that the user running the Docker container has access to the music directory.
Steps to Add Music Files
- Access Docker Container:
docker exec -it navidrome sh
- Navigate to Music Directory:Move to the music directory and add files using
cp
,mv
, orwget
.
Step 8: Accessing Navidrome
Once installed, you can access Navidrome using its web interface or compatible mobile apps.
Steps to Access Navidrome
- Web Interface:
- Open a web browser and navigate to
https://your-server-ip:4533
.
- Open a web browser and navigate to
- Mobile Apps:
- Use compatible mobile apps for iOS and Android devices.
Troubleshooting Common Issues
Common Errors and Solutions
- Container Keeps Shutting Down:
- Check Docker logs using
docker logs navidrome
. - Increase the log level to debug for more detailed logs by setting
ND_LOGLEVEL=debug
in your Docker run command. - Ensure that the container is configured to restart unless stopped (
--restart=unless-stopped
).
- Check Docker logs using
- Nginx Configuration Errors:
- Check Nginx logs for errors (
/var/log/nginx/error.log
). - Verify that the server block configuration is correct and that Nginx has been restarted after changes.
- Check Nginx logs for errors (
- Firewall Issues:
- Ensure that ports 80, 443, and 4533 are open in the firewall.
- Reload firewall rules after making changes.
Additional Troubleshooting Tips
- Check System Resources: Ensure your server has enough RAM and CPU resources to run Navidrome smoothly.
- Update Docker Images: Regularly update Docker images to ensure you have the latest features and security patches.
Congratulations! You have successfully installed Navidrome. Thanks for using this tutorial for installing Navidrome on the AlmaLinux 9 system. For additional help or useful information, we recommend you check the official Navidrome website.