DebianDebian Based

How To Install Navidrome on Debian 12

Install Navidrome on Debian 12

Managing your personal music library can be challenging in today’s streaming-dominated world. Navidrome offers a robust solution by providing a self-hosted music server that gives you complete control over your audio collection. This guide walks you through installing Navidrome on Debian 12, allowing you to stream your music collection from anywhere while maintaining privacy and ownership of your media files.

Navidrome stands out as an excellent choice for music enthusiasts who prefer to own their music rather than rely on subscription services. Its modern interface, coupled with the stability of Debian 12, creates a reliable streaming platform that works across multiple devices. Whether you’re a Linux veteran or a newcomer to self-hosting, this tutorial provides clear, actionable steps to get your music server up and running.

What is Navidrome?

Navidrome is an open-source, web-based music collection server and streamer that provides access to your music library from anywhere through a sleek, modern web interface. Licensed under GNU GPL, it’s designed as a self-hosted alternative to services like Spotify or Apple Music, giving you full control over your music files and listening experience.

At its core, Navidrome indexes your music files, creating a database of your collection complete with metadata, album art, and organization features. It supports numerous audio formats including MP3, FLAC, OGG, and many others. One of Navidrome’s standout features is its compatibility with the Subsonic API, enabling it to work with numerous third-party mobile applications on both Android and iOS platforms.

Unlike resource-intensive media servers, Navidrome is remarkably lightweight. It can run efficiently on modest hardware—even a Raspberry Pi can handle substantial music libraries. This efficiency makes Debian 12 an ideal platform for hosting Navidrome, as the operating system’s stability and performance complement the music server’s modest resource requirements.

Key features that make Navidrome appealing include:

  • Multi-user support with individual preferences and playlists
  • Responsive interface that works on desktops, tablets, and phones
  • Transcoding capabilities to optimize streaming based on connection speed
  • Artist biographies and album reviews from Last.fm
  • Advanced search functionality
  • Support for multiple languages
  • Integration with existing Subsonic clients

Prerequisites

Before diving into the installation process, ensure your system meets the necessary requirements. Navidrome’s lightweight nature means it doesn’t demand powerful hardware, but certain components are essential for a smooth experience.

Hardware Requirements

  • CPU: Any modern processor (even single-core will work for basic usage)
  • RAM: Minimum 1GB (2GB or more recommended for larger libraries)
  • Storage: Sufficient space for your music collection plus approximately 100MB for the application
  • Network: Basic connectivity for local streaming; stable internet connection for remote access

Software Requirements

Before installation, update your Debian 12 system to ensure all packages are current:

sudo apt update
sudo apt upgrade

Install these essential dependencies:

sudo apt install ffmpeg curl wget git unzip

FFmpeg is particularly crucial as Navidrome uses it for transcoding audio files on the fly. Without it, you might encounter playback issues with certain file formats or when streaming to devices with limited codec support.

You’ll also need root or sudo privileges on your Debian 12 system to complete the installation. If you haven’t configured sudo access yet, you can do so by adding your user to the sudo group:

su -
usermod -aG sudo your_username
exit

Log out and back in for the changes to take effect. With these prerequisites in place, you’re ready to proceed with the installation.

Installation Methods Overview

Navidrome offers several installation methods, each with distinct advantages. Your choice depends on your comfort level with Linux and your specific requirements.

The three primary installation approaches are:

  • Docker Installation: The simplest method for beginners, providing an isolated environment with dependencies pre-configured. This approach minimizes potential conflicts with other system components and streamlines updates.
  • Binary Installation: A straightforward approach using pre-compiled binaries, offering a good balance between simplicity and customization. This method provides more direct control than Docker while avoiding the complexity of building from source.
  • Source Installation: The most advanced method, ideal for users who want complete control or need to modify the application. This approach allows for customizations but requires more technical knowledge.

Consider your technical skills, desire for customization, and long-term maintenance plans when selecting your preferred method. This guide covers all three approaches comprehensively, allowing you to make an informed decision.

Method 1: Installing Navidrome using Docker

Docker provides the most straightforward installation experience, encapsulating Navidrome and its dependencies in a container. This method isolates the application from your system, preventing potential conflicts and simplifying management.

Installing Docker on Debian 12

If Docker isn’t already installed on your system, follow these steps:

    1. Install required packages to allow apt to use repositories over HTTPS:
sudo apt install ca-certificates curl gnupg
    1. Add Docker’s official GPG key:
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
    1. Set up the Docker repository:
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    1. Update the package index and install Docker:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    1. Verify the installation by running a test container:
sudo docker run hello-world

Creating Docker Compose File for Navidrome

Docker Compose simplifies container management by defining services in a YAML file. Create a directory for Navidrome and set up the configuration:

mkdir -p ~/navidrome/data
cd ~/navidrome
nano docker-compose.yml

Add the following content to the docker-compose.yml file:

version: "3"
services:
  navidrome:
    image: deluan/navidrome:latest
    container_name: navidrome
    restart: unless-stopped
    ports:
      - "4533:4533"
    environment:
      - ND_SCANSCHEDULE=1h
      - ND_LOGLEVEL=info
      - ND_BASEURL=/
    volumes:
      - ./data:/data
      - /path/to/your/music:/music:ro

Replace /path/to/your/music with the actual path to your music library on the host system. The :ro suffix makes the volume read-only, providing an extra layer of security.

Starting Navidrome Container

Launch the container using Docker Compose:

cd ~/navidrome
sudo docker-compose up -d

Verify the container is running correctly:

sudo docker ps

You should see the Navidrome container listed with status “Up”. Docker automatically configures the container to restart after system reboots, ensuring your music server remains available.

The advantages of using Docker include simplified updates (just pull the latest image), easy rollbacks if needed, and minimal impact on your host system. This isolation is particularly valuable on systems where you run multiple services.

Method 2: Binary Installation

The binary installation method offers more direct control over Navidrome while avoiding the complexity of building from source. This approach is ideal for users who prefer not to use Docker but still want a straightforward installation process.

Setting Up Directories and User

For improved security, it’s recommended to run Navidrome under a dedicated system user with limited permissions:

sudo useradd -r -s /bin/false navidrome
sudo mkdir -p /opt/navidrome/music
sudo mkdir -p /var/lib/navidrome

Downloading and Installing the Binary

Download the latest Navidrome release for your system architecture. For a 64-bit system:

cd /tmp
wget https://github.com/navidrome/navidrome/releases/latest/download/navidrome_linux_amd64.tar.gz
sudo tar -xvzf navidrome_linux_amd64.tar.gz -C /opt/navidrome

Set appropriate permissions:

sudo chown -R navidrome:navidrome /opt/navidrome
sudo chown -R navidrome:navidrome /var/lib/navidrome

Creating Configuration File

Create a configuration file to customize Navidrome’s behavior:

sudo nano /opt/navidrome/navidrome.toml

Add the following basic configuration:

MusicFolder = "/opt/navidrome/music"
DataFolder = "/var/lib/navidrome"
LogLevel = "info"
Port = "4533"
BaseURL = ""
ScanSchedule = "@every 1h"

The configuration above sets the music and data folders, log level, port number, and automatic scan interval. Adjust these settings according to your preferences.

You can test if the binary works properly by running it manually:

sudo -u navidrome /opt/navidrome/navidrome --configfile=/opt/navidrome/navidrome.toml

If Navidrome starts without errors, press Ctrl+C to stop it, and proceed to set it up as a system service.

Method 3: Building from Source

Building Navidrome from source gives you the most control and ensures compatibility with your specific system architecture. This method is ideal for advanced users who want to modify the code or need the latest development features.

Installing Build Dependencies

First, install the necessary build tools and dependencies:

sudo apt install golang nodejs npm libtag1-dev build-essential git

The TagLib library (libtag1-dev) is particularly important as it allows Navidrome to read metadata from audio files correctly.

Cloning and Building the Repository

Clone the Navidrome repository and compile the application:

git clone https://github.com/navidrome/navidrome.git
cd navidrome
make setup
make build

This process compiles both the backend (Go) and frontend (JavaScript/React) components. Depending on your system’s performance, the build might take several minutes to complete.

After successful compilation, the binary will be available in the current directory:

./navidrome --version

To install the compiled binary for system-wide use:

sudo useradd -r -s /bin/false navidrome
sudo mkdir -p /opt/navidrome/music
sudo mkdir -p /var/lib/navidrome
sudo cp ./navidrome /opt/navidrome/
sudo chown -R navidrome:navidrome /opt/navidrome
sudo chown -R navidrome:navidrome /var/lib/navidrome

The source installation method gives you access to the latest features and bug fixes before they’re included in official releases. This approach also allows you to customize the code for specific requirements if needed.

Configuration

Regardless of your installation method, proper configuration ensures Navidrome performs optimally with your specific setup. The configuration file, navidrome.toml, controls all aspects of the server’s behavior.

Essential Configuration Options

The configuration file location depends on your installation method:

  • Docker: Managed through environment variables in docker-compose.yml
  • Binary: Usually at /opt/navidrome/navidrome.toml
  • Source: Created in the same directory as the binary

Here’s a comprehensive configuration example with commonly used options:

MusicFolder = "/path/to/music"
DataFolder = "/var/lib/navidrome"
LogLevel = "info"
Port = "4533"
Address = "0.0.0.0"
BaseURL = ""

# Scanning options
ScanSchedule = "@every 1h"
AutoImportPlaylists = true

# Security options
EnableUserManagement = true
AuthRequestLimit = 5
AuthWindowLength = "20s"
SessionTimeout = "24h"

# Transcoding options
EnableTranscodingConfig = true
TranscodingCacheSize = "100MB"
EnableDownloads = true

# UI customization
UIWelcomeMessage = "Welcome to my music server!"
DefaultTheme = "Dark"
DefaultLanguage = "en"

Security Considerations

Enhance your Navidrome installation’s security with these settings:

  • Strong Passwords: Enforce robust passwords for all user accounts.
  • Reverse Proxy: Use Nginx or Apache as a reverse proxy with HTTPS.
  • AuthRequestLimit: Limit login attempts to prevent brute force attacks.
  • Read-Only Music Folder: Mount your music folder as read-only to prevent accidental modifications.

Database Configuration

By default, Navidrome uses SQLite for its database, stored in the DataFolder. For larger libraries, consider using PostgreSQL or MySQL/MariaDB:

Database = "postgres://user:password@localhost/navidrome?sslmode=disable"
# Or for MySQL/MariaDB
# Database = "mysql://user:password@tcp(localhost:3306)/navidrome"

External databases provide better performance for large libraries and enable more advanced backup strategies. However, SQLite works well for most personal installations and requires no additional configuration.

Setting Up Navidrome as a Systemd Service

To ensure Navidrome starts automatically at boot and can be managed easily, configure it as a systemd service. This approach applies to both binary and source installations (Docker handles this automatically).

Creating the Service File

Create a systemd unit file:

sudo nano /etc/systemd/system/navidrome.service

Add the following content:

[Unit]
Description=Navidrome Music Server
After=network.target

[Service]
User=navidrome
Group=navidrome
Type=simple
ExecStart=/opt/navidrome/navidrome --configfile=/opt/navidrome/navidrome.toml
WorkingDirectory=/opt/navidrome
Restart=always
RestartSec=10
SyslogIdentifier=navidrome

# Optional security enhancements
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ReadWritePaths=/var/lib/navidrome

[Install]
WantedBy=multi-user.target

Enabling and Starting the Service

Reload systemd to recognize the new service file, then enable and start the service:

sudo systemctl daemon-reload
sudo systemctl enable navidrome
sudo systemctl start navidrome

Verify the service is running correctly:

sudo systemctl status navidrome

You should see “active (running)” in the output. If there are any issues, check the logs:

sudo journalctl -u navidrome -f

The systemd service configuration includes several security enhancements like NoNewPrivileges and ProtectSystem that restrict what the Navidrome process can do, improving overall system security. The Restart=always directive ensures the service recovers automatically from any crashes.

First-Time Setup and Usage

With Navidrome installed and running, it’s time to access the web interface and configure your music server for daily use.

Accessing the Web Interface

Open your web browser and navigate to:

http://your_server_ip:4533

On first access, you’ll be prompted to create an admin account. Choose a strong password that includes a mix of uppercase and lowercase letters, numbers, and special characters.

Install Navidrome on Debian 12

Initial Library Scan

After creating your admin account, Navidrome automatically begins scanning your music folder. For large libraries, this initial scan may take considerable time, depending on your hardware and collection size.

You can monitor the scan progress in the web interface under “Settings” → “About”. The system shows the number of artists, albums, and tracks indexed so far.

Interface Navigation

The Navidrome interface features a clean, intuitive layout with these main sections:

  • Library: Browse your music by Artists, Albums, Genres, etc.
  • Playlists: Create and manage playlists
  • Favorites: Quick access to starred songs, albums, and artists
  • Settings: Adjust user preferences and system settings
  • Search: Quickly find specific artists, albums, or tracks

User Management

To add additional users, navigate to “Settings” → “Users” and click “Add User”. For each user, you can configure:

  • Access level (admin or regular user)
  • Maximum bit rate for streaming
  • Download permissions
  • Shared playlists access

Creating separate accounts for family members or friends allows everyone to maintain their own playlists and favorites without affecting others’ experiences.

Mobile Apps and Remote Access

Navidrome’s compatibility with the Subsonic API enables it to work with numerous third-party applications, extending your music experience beyond the web interface.

Compatible Mobile Applications

Popular mobile apps that work with Navidrome include:

  • Android: DSub, Ultrasonic, Subtracks, and Symphony
  • iOS: Play:Sub, Amperfy, and Substreamer

When configuring these apps, use your Navidrome server address, username, and password. In the server settings, you’ll typically need to specify:

Server address: http://your_server_ip:4533
Username: your_username
Password: your_password
Use HTTPS: Depends on your setup
API version: Usually "Subsonic API"

Setting Up Remote Access

For secure remote access outside your home network, consider these options:

  1. Reverse Proxy with HTTPS: The most secure approach, using Nginx or Apache with Let’s Encrypt certificates.
  2. VPN Solution: Access your home network via VPN and connect to Navidrome locally.
  3. Port Forwarding: A simpler but less secure method, forwarding port 4533 on your router.

If implementing remote access, always enhance security by using strong passwords and limiting login attempts. Consider changing the default port (4533) to make your server less discoverable to potential attackers.

Performance Optimization

Optimize Navidrome’s performance to ensure smooth playback and responsive browsing, especially with large music libraries.

Scan Optimization

For large libraries, adjust these settings in navidrome.toml:

ScanSchedule = "@every 24h"
AutoImportPlaylists = true
ScanPriority = 0

Setting ScanPriority to 0 lowers the process priority, reducing the impact on system performance during scans. Scheduling scans during low-usage periods (like overnight) minimizes interference with playback.

Transcoding Settings

Optimize transcoding for your typical usage scenario:

EnableTranscodingConfig = true
TranscodingCacheSize = "500MB"
TranscodingCachePath = "/var/cache/navidrome"

Increasing cache size improves performance for frequently played songs. Consider using hardware acceleration if available:

ffmpegTranscodingOptions = "-threads 2 -vn -b:a %bk -bufsize 500k"

For Raspberry Pi or other ARM devices, reduce the processing load by limiting transcoding quality:

MaxTranscodingSize = "1G"
DefaultTranscodingBitrate = 128

Database Optimization

For libraries exceeding 10,000 tracks, consider migrating from SQLite to PostgreSQL or MySQL/MariaDB. This significantly improves performance for search operations and concurrent access.

Troubleshooting Common Issues

Even with careful installation, you might encounter issues. Here are solutions for common problems:

Scanning Problems

  • Files Not Showing Up: Check file permissions; ensure the navidrome user can read your music files.
  • Metadata Issues: Use tools like MusicBrainz Picard to standardize your metadata before scanning.
  • Slow Scans: Add excludePattern to skip certain directories:
    excludePattern = "^\\.|\\.sample$|\\.bak$"

Connection Problems

  • Cannot Access Web UI: Verify the service is running (systemctl status navidrome) and check if the configured port is open in your firewall.
  • Mobile App Cannot Connect: Ensure you’re using the correct server address and API version in app settings.
  • Intermittent Connection Issues: Check your network stability and consider implementing a reverse proxy.

Playback Issues

  • Stuttering Playback: Lower the streaming bitrate in user settings or improve your network bandwidth.
  • Transcoding Errors: Verify FFmpeg is correctly installed and accessible to Navidrome.
  • Format Not Supported: Check logs to identify the problematic format and ensure FFmpeg includes the necessary codecs.

Log Checking

When troubleshooting, logs are invaluable. Access them based on your installation method:

  • Systemd Service: sudo journalctl -u navidrome -f
  • Docker: sudo docker logs -f navidrome
  • Log File: Check the location specified in LogPath configuration

Increase log verbosity temporarily to diagnose issues:

LogLevel = "debug"

Remember to change it back to “info” after resolving the problem to avoid filling your storage with logs.

Updating Navidrome

Keeping Navidrome updated ensures you have the latest features, security fixes, and performance improvements. The update process varies depending on your installation method.

Updating Docker Installation

Docker updates are straightforward:

cd ~/navidrome
sudo docker-compose pull
sudo docker-compose up -d

Docker automatically downloads the latest image and restarts the container with minimal downtime. Your data remains intact as it’s stored in persistent volumes.

Updating Binary Installation

For binary installations, download the latest release and replace the existing binary:

cd /tmp
wget https://github.com/navidrome/navidrome/releases/latest/download/navidrome_linux_amd64.tar.gz
sudo systemctl stop navidrome
sudo tar -xvzf navidrome_linux_amd64.tar.gz -C /opt/navidrome
sudo chown navidrome:navidrome /opt/navidrome/navidrome
sudo systemctl start navidrome

Updating Source Build

For source installations, pull the latest code and rebuild:

cd ~/navidrome
git pull
make setup
make build
sudo systemctl stop navidrome
sudo cp ./navidrome /opt/navidrome/
sudo chown navidrome:navidrome /opt/navidrome/navidrome
sudo systemctl start navidrome

Backup Before Updating

Always back up your configuration and database before updates:

sudo systemctl stop navidrome
sudo cp -r /var/lib/navidrome /var/lib/navidrome.backup
sudo cp /opt/navidrome/navidrome.toml /opt/navidrome/navidrome.toml.backup
sudo systemctl start navidrome

This backup ensures you can quickly restore your system if an update causes unexpected issues. The database contains all your playlists, favorites, and user data, making it particularly important to preserve.

Congratulations! You have successfully installed Navidrome. Thanks for using this tutorial for installing Navidrome on Debian 12 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