2023 / 04 / 06
Set up Jellyfin in Linux

Install your very own home media server.

linux
jellyfin
media server

Currently, the most popular media servers are Plex, Emby, and Jellyfin.

In this tutorial we’ll go with Jellyfin as it is completely open source, doesn’t offer any premium features, nor it needs an external account to function properly.

Installation

Let’s go with the easiest one: Using the available packages.

sudo pacman -S jellyfin-server jellyfin-web

Service management

You can manage the jellyfin service as any other, with systemctl.

To see the status of it:

systemctl status jellyfin.service

To start/restart it:

sudo systemctl start jellyfin.service
sudo systemctl restart jellyfin.service

To stop it:

sudo systemctl stop jellyfin.service

Mounting directories for jellyfin

The jellyfin service is owned by the jellyfin user, which doesn’t have access to your $HOME directory.

If you want it to scan files in a directory inside your $HOME your out of luck because the permissions for it are set in a way that only you are allowed inside —and it should remain that way, for your own security.

Let’s say you have a ~/media folder that you’d like jellyfin to have access to, what do you do?

Well, you create a directory at root, let’s say /jellyfin and then mount your ~/media in there, like this:

sudo mkdir /jellyfin
sudo mount --bind ~/media /jellyfin

# To unmount
# sudo umount /jellyfin

Now you can point libraries in the web client to /jellyfin and it’ll be scanned no problem.

The —maybe— downside to this approach is that you’ll have to remount after every system boot.
The workaround is to just move your media folder to root.

I know, it’s a matter of personal preference.
But I, for one, only mount it when it’s needed.
And only start the service when I’m going to watch something on the TV. :sunglasses:

Firewall configuration

To be able to connect to your server from the Android app or other devices —like Chromecasts, phones, tablets, etc.— in your local network, you’ll need to allow traffic to your server on port 8096.

Let’s say your local IP address is: 192.168.1.110, then to allow access from everything in your local network:

sudo ufw allow from 192.168.1.0/24 to any port 8096

If you’d like to give access to a specific IP address only —assuming your Chromecast is on 192.168.1.66— then this would do it:

sudo ufw allow from 192.168.1.66 to any port 8096

Web client

After starting the service, you’ll be able to access the web client by going to the following URL:

http://localhost:8096/

Here you’ll be able to set up libraries, users and other configuration options.

Android app

You can install the official app from the Play Store to stream content to your TV connected Chromecast.

Music player

There is Finamp if you want to stream music to your phone and download songs for offline listening.

Closing thoughts

It goes without saying that Jellyfin and the Jellyfin app are not perfect.

I have stumbled over a couple of bugs and UI/UX issues in both of them —like disappearing controls, stacking subtitles, not being able to cast 4k content to a normal Chromecast (even with transcoding)— but I think I can live with that for now, it’ll get only better with time.

That’s it for now, I’ll be updating these notes whenever I find something worth sharing. :v:

Links