Introduction
Through the rise of Spotify, we lost our connection to one of the most important media: audio.
While we get access to the entire music library of the whole world, we still tend to listen to the same or similar artists, playlists, and maybe even genres.
Overview
If you take a look into the world of self-hosting a music streaming service, there is a good collection to choose from.
I, for myself, chose Navidrome for the following reasons:
- Easy to set up
- Easy to configure
- Compatible with the Subsonic API
- Able to report your listens to Listenbrainz
As my music player, I chose 5 for the following reasons:
- Modern and familiar UI
- Compatible with Navidrome and Subsonic API
To collect stats and get new recommendations about my listening, I am using Listenbrainz for the following reasons:
- Detailed music stats
- New recommendations every week based on my previous music behavior
- Compatible with many music streaming providers, so you are not limited to self-host your own music to get more information about your music behavior
Subsonic API
The Subsonic API is an open REST interface that was developed over 15 years ago and has established itself as the de facto standard for self-hosted music streaming. Although the original Subsonic server is no longer actively developed, modern servers like Navidrome continue to use the API because it provides instant compatibility with a huge ecosystem of client apps for all platforms. Thanks to this standardization, developers don't have to rewrite their apps for every single server.
Navidrome
You can find the instructions on how to set up Navidrome here.
For myself, I use the Nix ecosystem to set up Navidrome, as it has its own service. This is the snippet to set it up if you run NixOS too:
{
lib,
...
}:
{
services.navidrome = {
enable = true;
settings = {
# Allowing navidrome to collect anonymized data on how you use navidrome. I personally turned it on as I really like navidrome and I want to contribute somehow to its development. If you do not want it, then you may just turn it off
# You can read more about it here:https://www.navidrome.org/docs/getting-started/insights/
EnableInsightsCollector = true;
# the path where you store all your music for example /mnt/music
MusicFolder = "/path/to/your/music/folder";
# The address which you want to use. As I use caddy to reverse proxy the domain to the address I will leave it on localhost. Otherwise if you do not own a domain, then change the address to: "0.0.0.0"
Address = "127.0.0.1";
Port = 4533;
EnableSharing = true;
# link your base url of the reverse proxy if you own a domain otherwise remove it.
BaseUrl = "https://navidrome.example.com";
};
};
# If you use caddy as a reverse proxy then you can setup the reverse proxy like that. Otherwise adjust it to nginx or other service which you use.
services.caddy.virtualHosts = {
"navidrome.example.com" = {
extraConfig = ''
reverse_proxy localhost:4533
'';
};
};
}
Once Navidrome is online, you can connect it. If your Navidrome instance is public, then connect to it quickly, as you need to set up the admin account. You can read more about it here.
Once that's done, Navidrome will start indexing your music folder.
As I like to separate administration accounts from my own personal accounts, you may create a new account and limit the access according to your needs.
Navidrome allows you to stream your music directly through the web interface. If it's enough for you and you don't need another client and stats, then you are good to go from here!
Otherwise, if you want more control, then keep on reading :).
Feishin
You can read more about Feishin here.
Like Navidrome, the Nix ecosystem also offers a native package for Feishin.
You can add it to your system like this:
NixOS:
{
pkgs,
...
}:
{
environment.systemPackages = with pkgs; [
feishin
];
}
Home Manager:
{
pkgs,
...
}:
{
home.packages = with pkgs; [
feishin
];
}
Once Feishin is installed, start it, select Navidrome, and enter the URL and credentials of your Navidrome instance. Now you can start listening to your music collection, create playlists, and so on! :).
Listenbrainz
To connect Listenbrainz with your Navidrome instance, you need to create an account on Musicbrainz first. Then just follow the few steps according to the Navidrome documentation.
Now you can start listening to your music collection from any client. You do not need to listen to your music from the Navidrome web client. As long as you are connected to the account where the Listenbrainz API is connected, Navidrome will report your current listens to Listenbrainz.
You may now stalk me whenever I listen to new music!
Cool things I spotted with this setup
Offline Usage
Of course, you can listen to your own music offline!
Share your playlist with family & friends
Let's say you created the perfect playlist of all time, and you want to share it with your best friend.
Navidrome allows listening to playlists, even without an account.