description: Stream music from your local jellyfin server
date: 2024-07-15 07:00:00+0000
image: feishin.png
categories:
- Nix
- Piracy
tags:
- Jellyfin
- Music
- Homelab
- Selfhost
draft: false
writingTime: "1h 40m"
---
## Introduction
I have ditched all kind of subscription based services as of 2024. Spotify was one of my last subscriptions I cancelled and I have migrated to listening offline, then to online via my jellyfin server. I mainly listen to high-bitrate flac music that I pirate from sources like [soulseek](https://wl.vern.cc/wiki/Soulseek?lang=en). I have a collection of about 1000 music from 500 different artists.
I download flacs only to make my self feel better by saying I listen to HQ music but in reality I probably don't hear the difference between a 128kb compressed MP3 and a 1440kb ripped Flac. I also have a entry level [KZ ZS10 IEM](https://kz-audio.com/kz-zs10-pro.html) that I use with my on-board audio driver. I am also a based bass enjoyer, so all I really need is sub frequencies...
My main reason is privacy. I have yet to find a platform that respects my privacy and allows me to buy any kind of albums/songs with Bitcoin or Monero, therefore my last resort is to pirate. I could buy the original CD's but most artists I listen to don't have one, and I loath ripping.
Everyone has their own opinion about piracy, and I think in my case it's a 100% justified.
## Jellyfin
_Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media. It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps._
Jellyfin is a really great mediaserver, It has many clients and supports almost any kind of media, ranging from visual to audible.
I have been using it for about two years now, but recently I just realized I could stream my music from there instead of syncing my music to all my devices. For the past few days It has been a pleasureful experience and I have no complaints.
Sadly it's missing a download feature, meaning I cannot download music then listen to it on the road. Streaming flacs is really inefficient if you are using mobile data or some public wifi. I travel a lot meaning this is kind of a deal breaker, but I can just use my phone.
I had some problems with permissions when I was trying to use the native version from _nixpkgs_, so instead I just made an oci-container that uses linux namespaces to run applications.
# Open the ports for slskd so users can download from you
networking.firewall = {
enable = true;
allowedTCPPorts = [
50300
];
allowedUDPPorts = [
50300
];
};
services.nginx = {
virtualHosts = {
"soulseek.${config.networking.domain}" = {
forceSSL = true;
enableACME = true;
locations."/" = {
extraConfig = ''
proxy_pass http://localhost:5030;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_request_buffering off;
'';
};
};
};
};
}
```
Don't forget to open up the ports on your router so that users can download from you!
## Usage
### Create a music library for jellyfin
Head to the defined jellyfin domain, and log in with the credentials you have given.
On the top right click on the profile icon and head to `Dashboard` -> `Libraries` -> `Add Media Library` and add a new music library like in the picture.
Slskd is really easy to use, upon entering you are greeted with the search bar, type in anything and hit enter. Slskd will search other peers on the network for the string and return files.
![](slskd_search.png)
![](slskd_search_result.png)
After hitting download slskd will put it in `/home/jellyfin/Music/unsorted`.