How to deploy a self-hold music stream server(navidrome)
Posted onIntutorialViews: Word count in article: 5.2kReading time ≈5 mins.
If you are a music lover and have tons of music file like me, it is highly recommended to deploy a self-hold music stream server, with which you can get rid of paying to music provider. Now, I will teach you how to deploy Navidrome as your music stream server. In order to get a better performance, I am not going to install it with docker, I will install it manually.
How to install
First of all, use ssh to log in your server as root.
1 2 3 4 5
apt update apt upgrade apt install apache2 vim ffmpeg certbot python3-certbot-apache adduser navidrome # add a user for navidrome, as the official does not recommend us to install it as root vim /etc/sudoers
1
navidrome ALL=(ALL:ALL) ALL # add this line for temporary sudo permission, after installation, you can delete this line
1 2 3 4 5 6 7
su - navidrome sudo install -d -o navidrome -g navidrome /opt/navidrome sudo install -d -o navidrome -g navidrome /var/lib/navidrome wget https://github.com/navidrome/navidrome/releases/download/v0.50.2/navidrome_0.50.2_linux_amd64.tar.gz # get the latest release in official github release page: https://github.com/navidrome/navidrome/releases sudo tar -xvzf navidrome_0.50.2_linux_amd64.tar.gz -C /opt/navidrome/ sudochown -R navidrome:navidrome /opt/navidrome vim /var/lib/navidrome/navidrome.toml
[Unit] Description=Navidrome Music Server and Streamer compatible with Subsonic/Airsonic After=remote-fs.target network.target AssertPathExists=/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"
1 2 3 4 5
sudo systemctl daemon-reload sudo systemctl start navidrome.service sudo systemctl status navidrome.service sudo systemctl enable navidrome.service vim /etc/apache2/sites-available/your.domain.conf
# comment these lines related to ssl until you get your ssl certificate SSLEngine on SSLCertificateFile /etc/letsencrypt/live/your.domain/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/your.domain/privkey.pem
a2enmod rewrite ssl dav dav_fs proxy proxy_http systemctl restart apache2 mkdir /var/www/music chown -R www-data:www-data /var/www/music/ a2ensite your.domain.conf systemctl reload apache2 certbot certonly --apache -d your.domain htpasswd -c /etc/apache2/.htpasswd your_webdav_username # this command is to creat a user and password for your webdav service apache2 restart
Then, go to your.domain with browser, and set a admin account for your Navidrome.
How to use
You can upload and manage your music file via webdav