Skip to content

🎧 Installing Navidrome Music Server

navidrome-banner

Navidrome is an open source web-based music collection server and streamer. It gives you freedom to listen to your music collection from any browser or mobile device.

Info

The project is open-source and can be downloaded here: https://github.com/navidrome/navidrome.

Subtracks est une application de streaming de musique open source Android pour les serveurs compatibles Subsonic-API.

subtracks

Info

The project is open-source and can be downloaded here: https://github.com/austinried/subtracks.


πŸ“₯ Installation

πŸ“‹ Requirements

Info

Navidrome requires the installation of


🐳 Install Navidrome

The use of Docker Compose will automate the installation of navidrome container.

πŸ”§ Setup Navidrome Parameters

Before deploying, you need to define a few environment variables that will be used throughout the setup process.

  • HOST_PORT: external port used by NGINX to route traffic to the service
  • MUSIC_DIR: path to the music directory
# example of configuration for environment parameters
HOST_PORT=10020
MUSIC_DIR=/path/to/music
βš™οΈ Configure Navidrome for Docker Compose

Navidrome can be deployed using Docker Compose. The compose.yml file will automatically incorporate the environment variables configured in the previous step. You can copy, paste, and run all of the following commands directly in your terminal.

# create docker directory
mkdir navidrome && cd navidrome
mkdir data
# setup of compose.yml
tee compose.yml > /dev/null <<EOF
services:
  navidrome:
    image: deluan/navidrome:latest
    container_name: navidrome
    user: "\${PUID}:\${PGID}"
    volumes:
      - ./data:/data:rw
      - \${ND_MUSIC_DIR}:/music:ro
    environment:
      - ND_DEFAULTTHEME=\${ND_DEFAULTTHEME}
      - ND_LOGLEVEL=\${ND_LOGLEVEL}
      - ND_SESSIONTIMEOUT=\${ND_SESSIONTIMEOUT}
      - ND_SCANSCHEDULE=\${ND_SCANSCHEDULE}
    ports:
      - \${HOST_PORT}:4533
    healthcheck:
      test: ["CMD", "wget", "--spider", "-q", "http://localhost:4533/"]
      start_period: 60s
      start_interval: 5s
      interval: 60s
      timeout: 1s
      retries: 3
    restart: unless-stopped
EOF
# setup of .env file
tee .env > /dev/null <<EOF
###################################################################################
# Run as non-root user
###################################################################################
PUID=`id -u`
PGID=`id -g`

###################################################################################
# NGINX Proxy Configuration
###################################################################################
HOST_PORT=${HOST_PORT}

###################################################################################
# Navidrome Configuration
###################################################################################
ND_DEFAULTTHEME=nord
ND_LOGLEVEL=warn
ND_SESSIONTIMEOUT=1h
ND_SCANSCHEDULE=24h
ND_MUSIC_DIR=${MUSIC_DIR}
EOF

Save the .env informations

All the secret informations are defined in the .env file.

🐳 Install Navidrome with Docker Compose

Now that the compose.yml file has been generated, it's time to install all the containers.

# install and start the container
docker compose up -d

πŸš€ Deploy Navidrome

Install NGINX

NGINX needs to be installed, follow the NGINX section.

Configure NGINX

NGINX needs to be configured using a file in /etc/nginx/sites-available directory.
This configuration file specify the documentation path:

server {
  server_name navidrome.domain.fr;

  # setup 404 error_page
  error_page 404 /404.html;
  include snippets/error-404.conf;

  # reverse proxy
  location / {
    proxy_pass http://127.0.0.1:10020;

    # keep it HTTP/1.1
    proxy_http_version 1.1;

    # forwarded headers
    include proxy_params;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Port $server_port;

    # application-specific tuning
    proxy_read_timeout 300s;
    proxy_send_timeout 300s;
    client_max_body_size 200M;
  }
}
# enable site for production
sudo ln -s /etc/nginx/sites-available/navidrome.domain.fr /etc/nginx/sites-enabled/navidrome.domain.fr

# restart nginx
sudo nginx -t && sudo service nginx restart

Replace navidrome.domain.fr by the name of your website.

Activate HTTPS

To activate HTTPS protocol, follow theΒ Let's Encrypt section.


βš™οΈ Configure Navidrome

Change admin password

For security reasons, you must change the default administrator password immediately.
To authenticate on the server, use:

  • user: admin

navidrome-admin