In this article, we will guide you through the process of installing Navidrome with Docker on AlmaLinux 8. Navidrome is a powerful music streaming server that allows you to access your music collection from anywhere using a modern web interface and compatible mobile apps for both iOS and Android. By following the steps outlined in this guide, you will be able to set up Navidrome on your AlmaLinux 8 system and start enjoying your music library right away.
Step 1: Install Nginx
The first step in setting up Navidrome is to install Nginx, which will act as a reverse proxy for the Navidrome server. Nginx is a popular web server and proxy server that can handle high traffic loads efficiently.
To install Nginx on AlmaLinux 8, follow these steps:
- Open a terminal or SSH into your AlmaLinux 8 system.
- Run the following command to install Nginx:
yum install nginx -y
- Once the installation is complete, enable and start the Nginx service by running the following commands:
systemctl enable nginx systemctl start nginx
- To verify that Nginx is running properly, run the following command:
systemctl status nginx
Step 2: Enable Firewall
Next, we need to enable the necessary firewall rules to allow incoming HTTP and HTTPS traffic to our Navidrome server. By default, AlmaLinux 8 uses firewalld as the firewall management tool.
To enable the HTTP and HTTPS services in the firewall, use the following commands:
firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=https firewall-cmd --reload
These commands will add the HTTP and HTTPS services to the firewall and reload the firewall rules.
Step 3: Install Let’s Encrypt SSL Certificate
To secure our Navidrome installation with an SSL certificate, we will use Let’s Encrypt, a free and open certificate authority. Let’s Encrypt provides trusted SSL certificates that can be automatically renewed.
To install the Let’s Encrypt SSL certificate on your AlmaLinux 8 system, follow these steps:
- Install the EPEL repository and the mod_ssl package by running the following command:
dnf install epel-release mod_ssl -y
- Next, install the certbot client, which is used to create Let’s Encrypt certificates:
dnf install python3-certbot-nginx -y
- Once the installation is complete, use the following command to issue a Let’s Encrypt certificate. Replace
dev.domainhere.info
anddev@dev.domainhere.info
with your domain name and email address:
certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email dev@dev.domainhere.info -d dev.domainhere.info
Please note that SSL certificates are valid for 90 days, but the renewal process is automated, so you don’t have to worry about renewing them manually.
- Finally, restart Nginx to apply the new SSL certificate:
systemctl restart nginx
Congratulations! You have successfully installed the Let’s Encrypt SSL certificate on your AlmaLinux 8 system.
Step 4: Configuring Nginx Server Blocks
Now that we have Nginx installed and the SSL certificate configured, we need to configure the Nginx server blocks to redirect incoming requests to the Navidrome server.
To configure the Nginx server blocks, follow these steps:
- Open the Nginx configuration file using your preferred text editor. In this example, we will use
nano
:
nano /etc/nginx/nginx.conf
- Replace the contents of the
nginx.conf
file with the following configuration:
# For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; }
- Save and exit the file by pressing
Ctrl+O
, thenCtrl+X
. - Create a new Nginx configuration file for your domain using the following command:
vi /etc/nginx/conf.d/dev.conf
- Add the following configuration to the
dev.conf
file. Make sure to replacedev.domainhere.info
and192.169.7.180
with your domain name and IP address, and adjust the SSL path according to your SSL configuration:
upstream app { server 192.169.7.180:4533; } server { listen 80 default_server; server_name dev.domainhere.info; return 301 https://$server_name$request_uri; } server { listen 443 ssl; # managed by Certbot # The host name to respond to server_name dev.domainhere.info; ssl_certificate /etc/letsencrypt/live/dev.domainhere.info/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/dev.domainhere.info/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot location / { proxy_pass http://app; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_set_header X-Real-Port $server_port; proxy_set_header X-Real-Scheme $scheme; } }
- Save and exit the file by pressing
Esc
, then:wq!
, and finally pressingEnter
. - If you have SELinux enabled on your system, run the following command to allow Nginx to connect to the network:
setsebool -P httpd_can_network_connect 1
- Restart Nginx to apply the new configuration:
systemctl restart nginx
- Finally, verify that Nginx is running properly by running the following command:
systemctl status nginx
Step 5: Enable Port 4533
By default, Navidrome listens on port 4533 for incoming connections. To enable connection through this port, we need to update the firewall rules.
Follow these steps to enable port 4533 in the firewall:
- Open a terminal or SSH into your AlmaLinux 8 system.
- Run the following commands to allow incoming TCP traffic on port 4533:
firewall-cmd --zone=public --permanent --add-port 4533/tcp firewall-cmd --reload
These commands will add the necessary firewall rules to allow incoming connections on port 4533.
Step 6: Install Navidrome with Docker
Now that we have all the prerequisites in place and the necessary configurations done, we can proceed with the installation of Navidrome using Docker.
To install Navidrome with Docker, follow these steps:
- Open a terminal or SSH into your AlmaLinux 8 system.
- Run the following command to install Navidrome using the Navidrome Docker image:
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
Make sure to replace /path/to/music
and /path/to/data
with the actual paths to your music and data directories.
- The installation process will start, and Navidrome will be up and running in a Docker container.
Step 7: Adding Music/Audio Files to Navidrome
To start enjoying your music collection with Navidrome, you need to add your music/audio files to the server. Fortunately, this process is straightforward.
To add music/audio files to Navidrome, follow these steps:
- Open a terminal or SSH into your AlmaLinux 8 system.
- Use the following command to access the Docker container running Navidrome:
docker exec-it navidrome sh
- Once you are inside the Docker container, navigate to the music directory by running the following command:
cd music
Replace music
with the actual directory where your music files are located.
- Now, you can add your music/audio files directly to the
music
directory. You can use commands likecp
,mv
, orwget
to add files from various sources.
For more information about adding music/audio files to Navidrome, refer to the official Navidrome documentation.
Step 8: Accessing Navidrome
Once you have installed Navidrome and added your music/audio files, you can access the Navidrome web interface from any browser. Simply enter the IP address or domain name configured on your server followed by the appropriate port number.
To access Navidrome, follow these steps:
- Open a web browser on your device.
- Enter the IP address or domain name of your server, followed by the port number
4533
. For example:https://dev.domainhere.info
.Replacedev.domainhere.info
with the actual IP address or domain name configured on your server. - Press Enter to load the Navidrome web interface.
Congratulations! You have successfully installed Navidrome with Docker on your AlmaLinux 8 system. You can now enjoy your music collection from anywhere using the modern web interface provided by Navidrome.
Conclusion
In this article, we have covered the step-by-step process of installing Navidrome with Docker on AlmaLinux 8. By following this guide, you have set up a powerful music streaming server that allows you to access your music collection from anywhere, using a modern web interface and compatible mobile apps. With Navidrome, you can enjoy your favorite tunes on the go, whether you’re using an iOS or Android device.
If you’re looking for reliable and scalable cloud hosting solutions, consider Shape.host. They offer Cloud VPS services with 24/7 in-house customer support, starting at just $5/month. With Shape.host, you can trust that your hosting needs are in capable hands.
So why wait? Start streaming your music with Navidrome today and elevate your music listening experience to a whole new level!