A Novel about my FreeBSD journey

Install Navidrome Music Server on FreeBSD

In this tutorial, I explain how to install the Navidrome music server on FreeBSD.

What is Navidrome?

Navidrome is an open-source web-based music collection server and streamer. It gives us the freedom to listen to our music collection from any browser
or mobile device. It's like our own personal Spotify!

Furthermore, it offers the following feature:

How can we install it?

Installation is simple, we just need to run the following command:

$: pkg install navidrome

After the installation is through, we can then edit the corresponding configuration file.

$: nano /usr/local/etc/navidrome/config.toml

You can have a look at it. You will find a lot of configuration options. What is important is that you set the path to your music collection correctly.

If you have configured the whole thing according to your wishes, we still have to activate the RC service and then start it once.

$: servive navidrome enable
$: servive navidrome start

Nginx configuration

We use Nginx as a reverse proxy server. Likewise, we now create the following file under /usr/local/etc/nginx/vhosts:

$: nano /usr/local/etc/nginx/vhosts/navidrome.conf  ⇒

server {
    server_name navidrome.domain;

    location / {
        proxy_pass http://127.0.0.1:4533;
        proxy_http_version 1.1;
        proxy_cache_bypass $http_upgrade;

        # proxy headers
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-forwarded-port $server_port;

        # proxy timeouts
        proxy_connect_timeout 60s;
        proxy_send_timeout 60s;
        proxy_read_timeout 60s;
    }
}

In our /etc/hosts, we add the following line.

$: nano /etc/rc.conf ⇒

127.0.0.1 navidrome.domain

Then we restart the Nginx.

$: service nginx restart

We can now open Navidrome via the web browser.

Discuss...