Development Environment
This is just a summary on how to get started. If you are stuck or have any questions, please join our Discord server and give us a shout on the #dev
channel
Any IDE with good support for GoLang and JavaScript/Node can be used for Navidrome development. We suggest using Visual Studio Code, which has excellent support for both languages.
Using VSCode + Dev Container (Docker)
The project includes a VSCode Dev Container configuration for using with Docker. The Dev Container provides all dependencies out-of-the-box. If you prefer to install all dependencies yourself, or cannot/don’t want to install Docker for any reason, see the other sections below for step by step instructions for your OS.
Note
Keep in mind that the overall experience when using Docker Desktop for development will be slower than normal, because access to the host OS filesystem is generally slower. If you want to have full performance, we recommend installing the dependencies directly on your system and skip using Docker for development.Unix-based systems (Linux, macOS, BSD, …)
-
Install GoLang 1.22+
-
Install Node 20
-
Install TagLib, preferable version 2.0
- Ubuntu:
sudo apt install libtag1-dev
- Arch Linux:
pacman -S taglib
- Fedora:
dnf install taglib-devel
- macOS:
brew install taglib --HEAD
- For other platforms check their installation instructions
- Ubuntu:
-
Install
pkg-config
-
Clone the project from https://github.com/navidrome/navidrome
-
Install development tools:
make setup
. This may take a while to complete -
Test installation:
make build
. This command should create anavidrome
executable in the project’s folder -
Create a
navidrome.toml
config file in the project’s folder with (at least) the following options:
# Set your music folder, preferable a specific development music library with few songs,
# to make scan fast
MusicFolder = "/path/to/music/folder"
# Make logging more verbose
LogLevel = "debug"
# This option will always create an `admin` user with the specified password, so you don't
# have to create a user every time you delete your dev database
DevAutoCreateAdminPassword = "password"
# Move the data/DB folder out of the root. `./data` folder is ignored by git
DataFolder = "./data"
# If you are developing in macOS with its firewall enabled, uncomment the next line to avoid
# having to accept incoming network connections every time the server restarts:
# Address = "localhost"
To start Navidrome in development mode, just run make dev
. This will start both the backend
and the frontend in “watch” mode, so any changes will automatically be reloaded. It will open
Navidrome automatically in your browser, using the URL http://localhost:4533/
If it does not open a new window in your browser, check the output for any error messages.
For more useful make
targets, run make help
.
Building it locally
To build Navidrome locally, follow these steps:
- Make sure you have all the dependencies installed as mentioned in the previous sections.
- Open a terminal and navigate to the project’s folder.
- Run the command
make build
to build the whole project. This will create anavidrome
binary in the project’s folder
Building with Docker
If you want to build Navidrome for a different platform than your own dev environment, use make single
and specify the OS/Platform as parameters. Example for Linux/ARM:
make single GOOS=linux GOARCH=arm
If you want to build a Docker image with your local changes, use make docker
. Note that this command only build images for linux/amd64
. The built image will be tagged locally as deluan/navidrome:develop
Windows (using WSL)
Even though it is possible to setup a fully working Navidrome development environment in Windows, we currently don’t provide instructions for that (feel free to contribute to these docs if you successfully set it up).
The (arguably better) alternative is to set up the project using Visual Studio Code and WSL, which effectively lets you develop in a Linux environment while still using your Windows system.
Installing WSL
- Make sure your Windows 10 is updated.
- Go to Settings > Turn Windows feature on or off > Windows subsystem for Linux.
- Go to Microsoft Store and download and install any Linux distro you like. For maximum compatibility, we recommend Ubuntu.
- Open Downloaded Linux distro, add username and password and then update it using:
sudo apt update && sudo apt upgrade -y
. - Install needed compilers for building Navidrome:
sudo apt install gcc g++
- This will create an Linux terminal where you can execute any Linux commands.
Make sure you are using WSL 2.0
Configuring Visual Studio Code
- Click on Extensions (present on leftmost column), install Remote Development extension and reload VSCode.
- Press F1, execute Remote-WSL: New Window. This will connect your installed Linux distro to VSCode.
- Now you can open a VSCode terminal and you’ll be able to run any Linux command.
Common Issues
- Because of this WSL issue you need to use your network IP address to be able to login to Navidrome in development mode. Otherwise you will get an
Error: Unauthorized
when logging in. You can see your network IP address after runningmake dev
.
Now that you have a working instance of Linux running on your machine, follow the steps above for Unix-based system in the VSCode terminal. For more information on working with VSCode+WSL, check their documentation.
Troubleshooting
System limit for number of file watchers reached
If you encounter the Error: ENOSPC: System limit for number of file watchers reached, watch
while running make dev
on Linux systems, then your system is maxing out the number of files that can be “watched” for changes at one time.
To increase this limit, you can run the command echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
, which adds the line fs.inotify.max_user_watches=524288
to /etc/sysctl.conf
and reloads sysctl so the change takes effect. this allows inotify
to watch more files and folders for changes at a time.
More information about this can be found here
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can make it even better.
Sorry to hear that. Please tell us how we can improve.