Navidrome with Docker in Ubuntu 24.04 LTS
Navidrome with Docker in Ubuntu 24.04 LTS

In this wright up, we will be using Ubuntu 24.04.

Navidrome is a lightweight, self-hosted music server that lets you stream your personal music collection anywhere, on any device. It’s fast, modern, and works seamlessly with Subsonic-compatible apps. Pairing Navidrome with Docker makes installation and management much easier, as it keeps everything isolated and simple to update.

In this guide, we’ll walk through the process of installing Navidrome on Ubuntu 24.04 using Docker. By the end, you’ll have an efficient music streaming server up and running, ready to serve your library across your devices.

Before setting up Docker and Navidrome, it’s worth considering where you’ll host your Docker environment: on bare metal, a virtual machine (VM), or an LXC container. Each approach has its own advantages and trade-offs. Running on bare metal gives you the best performance and direct hardware access, but it lacks flexibility if you want to isolate or quickly redeploy services. Using a VM provides strong isolation and makes it easier to snapshot, back up, or migrate your server, though this comes at the cost of some extra overhead. LXC containers strike a middle ground — they’re lighter than VMs and more flexible than bare metal, but they share the host’s kernel, which means slightly less isolation and possible compatibility issues for certain workloads. Your choice depends on whether you prioritize performance, portability, or ease of management.

OS Prep For Docker Install

Update Ubuntu

apt update && apt upgrade -y

apt update

&&

apt upgrade -y

Install curl

        cURL (short for Client URL) is a command-line tool used to transfer data to or from a server. It supports a wide range of protocols, including HTTP, HTTPS, FTP, and         more, making it very versatile for downloading files, testing APIs, or sending data over the web. In practice, cURL is often used to quickly fetch web pages, download         installation scripts, or check connectivity between a server and a URL.

apt install curl -y

Make User for setup (this is for LXC)

adduser [username]

adduser [username] sudo

su [username]


Install Docker using script

curl -sSL https://get.docker.com | sh

Add user group docker to your user account

        When you install Docker, it creates a special user group called docker. By default, only the root user can run Docker commands, which means you’d have to type sudo         every time. Adding your user to the docker group lets you run Docker as a normal user without sudo, making it more convenient for everyday use. Keep in mind,         though, that this group has root-level access to the system, so you should only add trusted users.

adduser [username] docker

Now you need to log out and log back in for the group changes to take effect.

After that, log back in with your normal user account.

To remove the root user (if you would like)

passwd -l root 


Setting Docker up to run Navidrom

Create a dedicated user for Navidrome

        It’s a good idea to run services under their own user account. Let’s make one called Navidrome:

adduser Navidrom

Get user id and group ID

        We’ll need these IDs later for Docker permissions. Run:

id Navidrom

Create a working directory

Choose a location (such as your home folder) where you want Navidrome’s files to live.

mkdir Navidrom

cd Navidrom

Create the Docker Compose file

nano docker-compose.yml

Add the default configuration

Paste the following starter configuration into the file. This will work as-is, but we’ll improve it in the next step:

services:
  navidrome:
    image: deluan/navidrome:latest
    #user: 1000:1000 # should be owner of volumes
    ports:
      - "4533:4533"
    restart: unless-stopped
    # environment:
      # Optional: put your config options customization here. Examples:
      # ND_LOGLEVEL: debug
    volumes:
      - "/path/to/data:/data"
      - "/path/to/your/music/folder:/music:ro"
services:
  navidrome:
    image: deluan/navidrome:latest
    #user: 1000:1000 # should be owner of volumes
    ports:
      - "4533:4533"
    restart: unless-stopped
    # environment:
      # Optional: put your config options customization here. Examples:
      # ND_LOGLEVEL: debug
    volumes:
      - "/path/to/data:/data"
      - "/path/to/your/music/folder:/music:ro"

Set the correct user

Let's start making this config better by getting user working earlier I had you run id Navidrom that is the info we need to fix this line

remove the # and enter the valve that was output from the command for group and user

user: 1001:1001 # should be owner of volumes
user: 1001:1001 # should be owner of volumes

Save the file

CTRL + O   (write out)
ENTER      (confirm)
CTRL + X   (exit)
CTRL + O   (write out)
ENTER      (confirm)
CTRL + X   (exit)

You need to make a file to save Navidrome data in

mkdir /home/Navidrom/music/

mkdir /home/Navidrom/music/data

Now that you have the file made you need to set promotions to Navidrom can wright to it

sudo chown -R 1001:1001 /home/Navidrom/music/

        chown

        -R

        1001:1001

        /home/Navidrom/music/

It is now time to make a spot for your music (I like to keep mine in my home folder)

mkdir /home/[username]/MyMusic

With this file made we can reopen the docker-compose.yml file and change so lines.

nano docker-compose.yml

Change the lines to look like so

    volumes:
      - /home/Navidrome/music/data:/data
      - /home/[username]/music/MyMusic:/music:ro
    volumes:
      - /home/Navidrome/music/data:/data
      - /home/[username]/music/MyMusic:/music:ro

At this point you can start Navidrome if you would like

docker compose up -d

If you do go to your Browser and enter a url of http://{serverip}:4533