SelfHostCorner

perronedotdev
perronedotdev

Posted on • Originally published at perrone.dev on

Jellyfin on the Pi

Jellyfin is the volunteer-built media solution that puts you in control of your media. Stream to any device from your own server, with no strings attached. Your media, your server, your way.

Jellyfin on the Pi

In the previous article "Ditch those streaming services" I mentioned Jellyfin. This program is similar to what you may be used to with services such as Netflix and Hulu except that you host the videos yourself rather than them being on the cloud somewhere. If you are familiar with Plex, Jellyfin is very similar except it's open-source and completely free. I've been using it for a few years and have had zero issues. In this article I will go through the steps on how to install Jellyfin and get all of your media added.

Preparing for the install.

First let's make sure everything is up to date.

sudo apt update & sudo apt full-upgrade
Enter fullscreen mode Exit fullscreen mode

Next we will need to install a few packages to make sure that we can access the repository. The reason for this is that the package manager doesn't normally allow us to access repositories that are HTTPS.

sudo apt install apt-transport-https lsb-release
Enter fullscreen mode Exit fullscreen mode

Now we will import the key, which keeps everything secure and ensures that only signed packages are installed.

curl https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/jellyfin-archive-keyring.gpg >/dev/null
Enter fullscreen mode Exit fullscreen mode

This will add the repository to our Pi.

echo "deb [signed-by=/usr/share/keyrings/jellyfin-archive-keyring.gpg arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/debian $( lsb_release -c -s ) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list
Enter fullscreen mode Exit fullscreen mode

Finally, we will update the package list.

sudo apt update
Enter fullscreen mode Exit fullscreen mode

Installing Jellyfin.

This command will install the package we previously added to our list.

sudo apt install jellyfin
Enter fullscreen mode Exit fullscreen mode

The installation will automatically create a user named "jellyfin" and a service for it to run. The user it creates is used to access your files and run the service.

Accessing the web interface.

Now we just need to access it. If you don't already know the IP address to your server use the following command.

hostname -I
Enter fullscreen mode Exit fullscreen mode

Now open up your favorite browser and access http://Your.Server.IP:8096. Replace "Your.Server.IP" with that the hostname command provided you. It should look something like this: http://192.168.1.10:8096.

You will be greeted with a very simple setup wizard. Follow the steps to set up your language, username/password and adding of your media. Once this is done you will just need to login with the username and password that you set up and you are good to go.

If you added a large amount of media files it may take a while for everything to appear in your library.

Hardware Acceleration (Advanced Steps).

Hardware acceleration (HA) isn't great on the Pi, but it can be enabled to improve performance a bit.

First we need to add the user that the installation created to the video group.

sudo usermod -aG video jellyfin
Enter fullscreen mode Exit fullscreen mode

Since HA can use a lot of memory we will need to adjust the amount of memory that is available to the GPU. Once this file is opened you need to find the line starting with gpu_mem=. If this line doesn't exist we will add it.

sudo nano /boot/config.txt
Enter fullscreen mode Exit fullscreen mode

Find & edit or add the following line to the config.txt file. This is assuming you are using a Pi 4. For a Pi 3 you will want to set the amount a little lower. (ex: gpu_mem=256)

gpu_mem=320
Enter fullscreen mode Exit fullscreen mode

Once you have added the line, make sure to save the file and exit back into the command line.

Since we editted an important file we will need to reboot the Pi for it to take effect.

sudo reboot
Enter fullscreen mode Exit fullscreen mode

The rest of the steps will be done in the web interface that we accessed earlier.

  1. Login to your Jellyfin web interface.
  2. Access the Admin dashboard in your settings.
  3. Click "Playback".
  4. Access the dropdown menu under Hardware Acceleration.
  5. Select Video4Linux2(V4L2) from the dropdown.
  6. Scroll down and click the Save button.

That's it! Now you can access the web interface from any browser on your network or the Jellyfin app installed on your smart devices and enjoy all of your favorite Movies and TV Shows.

Be sure to check out Samba on the Pi for sharing your drives across your network.

💡

Visit the official website for more information about Jellyfin. You can also visit the documentation section for alternate installation methods on the Pi and other operating systems.

Top comments (2)

Collapse
 
alex profile image
Alex

Love the optimisation component and details of this post. Just curious how much of a % performance improvement did you see with the limited hardware acceleration config?

Collapse
 
perronedotdev profile image
perronedotdev • Edited on

Maybe I should word that differently. It doesn't really improve performance of the Pi itself. What I meant was performance as far as transcoding videos so that they can be played on unsupported devices. For example: The Jellyfin app on my Chromecast with Google TV won't play certain video formats. When you enable Hardware Acceleration it will transcode them into a playable format. Granted the Pi is not optimal for transcoding due to it's hardware limitations, it still works since I'm not running anything else too heavy on it. I really just need to upgrade to a more suitable server, but money is tight right now.