Navidrome on FreeBSD
Whew! It's been a crazy couple of weeks. Lots of OS installs, lots of configuration, its been a blast. Since I wrote the original draft of this article, I've spent a decent amount of time 'dancing with the Devil' (well Beastie the devil anyways!) and wanted to give this OS the review that it deserves because its pretty awesome. The ultimate goal of this project was to set up a FreeBSD VM on Proxmox to run Navidrome for a dedicated local music streaming service, and it runs fantastically, but not until I mananged to get past the slight learning curve of going from Linux to BSD. At the end of the day, it isn't hard, its just different (but different enough to put me a week behind on my writing schedule!) But I digress, lets dive into the world of FreeBSD. For a very brief history, the Berkely Software Distribution of Unix-based operating systems began in the 70s when some Berkley scientists got a Unix license from AT&T to improve on Unix. Starting in the late 80s, BSD developers started replacing the proprietary AT&T code with their own software, licensed under the BSD license. Fast forward a couple of years and an AT&T lawsuit later to 1994, and we have FreeBSD 2.0, the first officially free and open source version of the operating system. Now lets get started! You can download FreeBSD at https://www.freebsd.org/where/ and we're going to grab the FreeBSD 14.1-Release, amd64 version, find the *disc1.iso file, and grab that. My Proxmox instance that FreeBSD runs on has 6 cores and 8gb of RAM allotted to it, but honestly that's overkill. Especially considering that my laptop is running a FreeBSD VM on 2 cores and 4gb of RAM running a desktop environment and I have not experienced anything even remotely resembling lag. Point is, besides being inherently more secure, this OS is super lightweight and efficient but still has all of the tools that you need to complete your daily tasks. Once you get the ISO booted onto your machine of choice, we get to the installation menu, which looks a bit different if you're used to the Calimares-style installation window that comes with most Linux distros, but it's honestly pretty simple and the installation process itself takes like 10-20 seconds (seriously.) We're going to install, select default keymap, select a hostname, and then we get to optional system components. The only thing that I would grab from this is the System source tree (use spacebar to select/unselect.) We don't need testing or debugging, and portsnap has an EoL set for 2026, so we won't be grabbing Ports. Next is the partitioning, which I've just been doing Auto (ZFS) because I'm lazy and I'm working on VMs. We don't need stripe, especially considering the content that this device will be streaming is technically on my NFS drive, select your disk, select yes, and you see? YOU SEE? That was so fast! I absolutely love it. Now lets set the root password, select or network interface, set up IPv4 and DHCP, laugh at the machine when it asks if we want to configure IPv6, and then we need to configure the DNS. Go ahead and spacebar on the Search bar and find the mirror for your region and select it. Next, select your timezone, and we can go ahead and skip setting up the clock as NTP should take care of that. Speaking of which, next is Enabling Services, which you'll want to grab not just ntpd but also ntpd_sync_on_start or you'll be having all kinds of annoying time issues. Of course, keep sshd if you're going to be setting this up for server use, and activate moused if you plan on using FreeBSD as a desktop environment (you can change this in your rc.conf later on.) Next step is System Hardening, which I just grabbed all of these. There's nothing that interferes with the services that I'm trying to run in my environment and its a nice feeling knowing that my system has such features as these right out of the box. And to the final step, which is setting up your user. A lot of these fields you can just press Enter on, as the default response is what you'll answer anyway, just make sure to add yourself to the wheel group when it asks if you want your user to be in any other groups. After that you can confirm your choices and exit, and reboot the system to your new FreeBSD environment. And we're live. Go ahead and log in and if you're setting up a server you can go ahead and run an ifconfig (its UNIX baby!) to get your IP address and ssh into your machine, if not the intial setup is pretty much the same. Go ahead and use su to get into the root account and we're going to run freebsd-update fetch and then freebsd-update install once thats done to make sure all of our drivers and such are up to date. Then we're going to run pkg install, which will prompt us to download pkg, the package manager for FreeBSD. Then go ahead and run and update with pkg update && pkg upgrade -y (look familiar?) After that, download sudo and go ahead and open up visudo. G to go down to the bottom, scroll up until you find the line with %wheel ALL=(ALL:ALL) and delete the comment with x (make sure you're not doing the NO PASSWD option) then :wq or ZZ to save and quit. And that should be it for the intial setup with the root account, you can go ahead and exit out of it to try out your new sudo powers. At this point on my server, the goal was to just setup 1 service, Navidrome. For anybody unfamiliar, Navidrome is a program that allows your to host your music locally and play it across your network. Its licensed under the GNU GPL v3 license and is available at https://www.navidrome.org or in your favorite distro's repository, including FreeBSD's. So after grabbing that I needed to mount my NFS folder onto the machine, as I'm not actually storing any music on this device. Unlike most Linux distros, where you have to download some package like nfs-core-utils or something to setup NFS, FreeBSD comes with it out of the box and activating it is as easy as adding a line in your configuration file, which is going to be /etc/rc.conf. While it may not look like much, this config file is highly customizable for whatever you need your machine to do. Don't believe me? Go to /etc/default/rc.conf and you'll find a 700 line file detailing the rabbithole that is rc.conf. We're going to need to add 2 lines to the configuration file to set up NFS on the client, the first one being nfsuserd_enable="YES", pretty straightforward, then we add nfsuserd_flags="-domain 192.168.1.102", replacing my NFS local IP with whatever the server name that you want to connect to is. Make sure that you added the client IP to your /etc/exports file on your NFS server, along with an exportfs -ra and a nfs-kernel restart and you should be good to connect. You can go ahead and mount the drive with sudo mount -t nfs -o nfsv4 192.168.1.102:/mnt/share /mnt, of course replacing the IPs and file locations as needed. And there you have it, shared folder acquired. After that I grabbed Tmux so that I could still interact with the system while one window runs the service, then ran navidrome --musicfolder /mnt/Music and it was done. I opened up the service in my desktop's web browser, and there it was. The service updates your library extremely fast, and is great for larger collections, I've been thouroughly enjoying it all day. My biggest complaint is that I haven't found a way to remove duplicate tracks yet, but honestly I'm super happy with the results and even happier about discovering FreeBSD. I could honestly see myself using it as a lightweight work distro in the future and look forward to learning a lot more on my BSD journey. Thats it for today everybody, thanks for all of the patience with this one, have a great rest of your evening. Peace.