Installation
After trying Plex media server, I finally settled on Navidrome as it is specially made for music hosting.
It has better playlist management and is extremely simple to setup.
sudo wget https://github.com/navidrome/navidrome/releases/download/v0.58.0/navidrome_0.58.0_linux_arm64.tar.gz -O Navidrome.tar.gz\nsudo tar -xvzf Navidrome.tar.gz -C /opt/navidrome/\nsudo chmod +x /opt/navidrome/navidrome\nsudo chown -R piserver:piserver /opt/navidrome\n
mkdir /etc/navidrome && mousepad /etc/navidrome/navidrome.toml
Inside the config file, paste this.
LogLevel = 'DEBUG'
Scanner.Schedule = '@every 12h'
TranscodingCacheSize = '150MiB'
MusicFolder = '/usb/rpi_ext_1tb_sea/Music'
sudo apt install navidrome
This should install navidrome on your Pi. If you are using ufw firewall, don't forget to allow 4533 port.
Configuration
To make sure that navidrome can be run from any location, let's create a shortcut in bin folder.
sudo ln -s /opt/navidrome/navidrome /usr/local/bin/navidrome
To run navidrome, run this command.
navidrome --configfile /etc/navidrome/navidrome.toml
Now to setup autostart, lets create a service file.
sudo mousepad /etc/systemd/system/navidrome.service
Place the contents from this
text file in your service file. Make changes as required.
Now that service is set up, enable it and start it using systemctl. To host it out into the open internet, I used tailscale. It provides an IP which can be used as a public IP.
To use this with android, install Ultrasonic or Tempo from f-droid. There give the ip and port name you get from tailscale or whatever you are using to broadcast to the wild.
For windows, you can use Feishin or amp cast.
Once installed, if the media is on external storage, servers can't display it as linux locks the viewing of it or something like that.
To bypass this, we should mount the drive on a different path on startup. Follow
this guide.
Creating a mount directory with necessary permissions.
sudo mkdir /usb /usb/
sudo chown -R piserver:piserver /usb/ #replace with your pi username
sudo chmod -R 755 /usb/
Creating mounting entries in fstab
blkid /dev/sda1 #replace it with the id of the external device. You can find that using df, lsblk etc.
sudo mousepad /etc/fstab
# Add these lines in the file
#Mounting Seagate Expansion 1tb HDD (rpi_ext_1tb_sea) at /usb/rpi_ext_1tb_sea for plex
UUID= /usb/rpi_ext_1tb_sea ntfs defaults,auto,rw,nofail 0 1
After creating the mount points, unmount the drive and mount it again.
sudo umount /media/piserver/rpi_ext_1tb_sea
sudo systemctl daemon-reload
sudo mount /usb/rpi_ext_1tb_sea #You might get some permission denied error, but ignore it. To test if it worked, use below command.
ls /usb/rpi_ext_1tb_sea/* #All files in all folders will be displayed