AlmaLinuxRHEL Based

How To Install Navidrome on AlmaLinux 9

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:

  1. Update Your System:
    sudo dnf update -y
  2. Add the Docker Repository:
    sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
  3. Install Docker Engine:
    sudo dnf install docker-ce docker-ce-cli containerd.io
  4. Start and Enable Docker:
    sudo systemctl start docker
    sudo systemctl enable docker
  5. 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

  1. Open a Terminal: SSH into your AlmaLinux 9 system or open a terminal if you are working locally.
  2. Install Nginx:
    sudo dnf install nginx -y
  3. Enable and Start Nginx:
    sudo systemctl enable nginx
    sudo systemctl start nginx
  4. 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

  1. Enable HTTP and HTTPS Services:
    sudo firewall-cmd --permanent --add-service=http
    sudo firewall-cmd --permanent --add-service=https
  2. 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

  1. Install Certbot:
    sudo dnf install certbot python3-certbot-nginx -y
  2. 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

  1. Create a New File: In /etc/nginx/conf.d/, create a new file named navidrome.conf.
  2. 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.

  3. 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

  1. Add Firewall Rule:
    sudo firewall-cmd --zone=public --permanent --add-port=4533/tcp
  2. 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

  1. 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.

  2. Access Navidrome Web Interface:
    • Open a web browser and navigate to https://your-server-ip:4533 to access the Navidrome web interface.

Install Navidrome on AlmaLinux 9

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

  1. Access Docker Container:
    docker exec -it navidrome sh
  2. Navigate to Music Directory:Move to the music directory and add files using cp, mv, or wget.

Step 8: Accessing Navidrome

Once installed, you can access Navidrome using its web interface or compatible mobile apps.

Steps to Access Navidrome

  1. Web Interface:
    • Open a web browser and navigate to https://your-server-ip:4533.
  2. Mobile Apps:
    • Use compatible mobile apps for iOS and Android devices.

Troubleshooting Common Issues

Common Errors and Solutions

  1. 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).
  2. 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.
  3. 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.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button