Post

Navidrome Install - Debian 11

Navidrome can be used as a standalone server, that allows you to browse and listen to your music collection using a web browser. It can also work as a lightweight Subsonic-API compatible server, that can be used with any Subsonic compatible client.

Installation

The following steps have been tested on Ubuntu 18.04 and should work on all version 16.04 and above as well as other Debian based distros. Throughout these instructions the commands will have placeholders for the user () and group () you want to run Navidrome under and the music folder path (). If you are using an existing media library ensure the user has permissions to the media library.

Update and Install Prerequisites

Ensure your system is up to date and install ffmpeg.

1
2
sudo apt update && sudo apt upgrade
sudo apt install vim ffmpeg -y

Create Directory Structure

Create a directory to store the Navidrome executable and a working directory with the proper permissions.

1
2
sudo install -d -o <user> -g <group> /opt/navidrome
sudo install -d -o <user> -g <group> /var/lib/navidrome

Get Navidrome

Download the latest release from the releases page, extract the contents to the executable directory, and set the permissions for the files. (Replace the URL below with the one from the releases page):

1
2
3
wget https://github.com/navidrome/navidrome/releases/download/v0.XX.0/navidrome_0.XX.0_Linux_x86_64.tar.gz -O Navidrome.tar.gz
sudo tar -xvzf Navidrome.tar.gz -C /opt/navidrome/
sudo chown -R <user>:<group> /opt/navidrome

Create Configuration File

In the working directory /var/lib/navidrome create a new file named navidrome.toml with the following settings.

1
MusicFolder = "<library_path>"

For additional configuration options see the configuration options page.

Create a Systemd Unit Create a new file under /etc/systemd/system/ named navidrome.service with the following data.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
[Unit]
Description=Navidrome Music Server and Streamer compatible with Subsonic/Airsonic
After=remote-fs.target network.target
AssertPathExists=/var/lib/navidrome

[Install]
WantedBy=multi-user.target

[Service]
User=<user>
Group=<group>
Type=simple
ExecStart=/opt/navidrome/navidrome --configfile "/var/lib/navidrome/navidrome.toml"
WorkingDirectory=/var/lib/navidrome
TimeoutStopSec=20
KillMode=process
Restart=on-failure

# See https://www.freedesktop.org/software/systemd/man/systemd.exec.html
DevicePolicy=closed
NoNewPrivileges=yes
PrivateTmp=yes
PrivateUsers=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap
ReadWritePaths=/var/lib/navidrome

# You can uncomment the following line if you're not using the jukebox This
# will prevent navidrome from accessing any real (physical) devices
# PrivateDevices=yes

# You can change the following line to `strict` instead of `full` if you don't
# want navidrome to be able to write anything on your filesystem outside of
# /var/lib/navidrome.
ProtectSystem=full

# You can uncomment the following line if you don't have any media in /home/*.
# This will prevent navidrome from ever reading/writing anything there.
# ProtectHome=true

# You can customize some Navidrome config options by setting environment variables here. Ex:
# Environment=ND_BASEURL="/navidrome"

Start the Navidrome Service

Reload the service daemon, start the newly create service, and verify it has started correctly.

1
2
3
sudo systemctl daemon-reload
sudo systemctl start navidrome.service
sudo systemctl status navidrome.service

If the service has started correctly verify you can access http://localhost:4533.

Start Navidrome on Startup

1
sudo systemctl enable navidrome.service
This post is licensed under CC BY 4.0 by the author.