How to set up Jellyfin on Linux in Docker
Jellyfin is an open-source implementation of Plex. It is the perfect media server for those who don’t like Plex’s direction. This guide will show you how to deploy a Jellyfin server on Linux in Docker.
Installing Docker on Linux
To use Jellyfin on Linux as a Docker container, you will need to install Docker on your Linux server. There are many ways to install Docker on Linux. In this guide, we’ll install it as a Snap package.
Why a Snap package? Getting Docker working is as easy as snap install, and there is no need to waste time setting up dependencies, repositories, keys, etc. However, you must enable the Snap runtime to get Docker working as a Snap. Follow our guide on setting up Snap to get it working.
With the Snap package runtime on your Linux server, use the snap install command to install the latest version of Docker on your computer.
sudo snap install docker
After installing Docker on Linux, you can access it using the root account. You can log into root with the following command.
su -
Can’t access the root account on your Linux system? You will need to enable it. To enable it, run the commands below.
sudo -s passwd
With the root account logged in, you can access Docker with the Docker –help command. This command will show you all commands related to Docker. Alternatively, you can enable Docker for your user with the commands below.
sudo addgroup --system docker sudo adduser $USER docker newgrp docker sudo snap disable docker sudo snap enable docker
Pulling the Jellyfin docker image
With the Docker tool up and running on your Linux system, it is time to pull the Jellyfin Docker image from Dockerhub. Using the docker pull command, grab the software. This will only take a minute.
su -
docker pull jellyfin/jellyfin:latest
Pulling the Jellyfin Docker image is pretty hands-off. However, if you’d like to learn more about the Jellyfin Docker image to troubleshoot or to explore what you are setting up your system for, click here.
After grabbing the Jellyfin container, you need to use the mkdir command to create the “config” and “cache” folders. These folders will hold your Jellyfin configuration files and cache files.
Note: the configuration files for the Jellyfin container must be in /root
. Why? Snap Docker cannot interact with files outside the $HOME directory. If you try to move outside /root
, you will run into errors.
mkdir -p ~/jellyfin/{config,cache}
Once these two folders are created, you’ll be able to see them in the /root/jellyfin
directory. To access these folders, run the following commands.
su -
cd /root/jellyfin
Starting the Jellyfin docker container
To start the Jellyfin docker container for the first time, you must run the following docker run command. This command is modified from the one provided with official Jellyfin documentation to function with the Snap version of Docker.
su -
docker run -d -v /root/jellyfin/config:/config -v /root/jellyfin/cache:/cache -v /media:/media --net=host jellyfin/jellyfin:latest
Once the above command is run, Docker will set up your Jellyfin image, folders, networking, etc. This process shouldn’t take long. When the container is started, you can access it via the following URL.
HTTP://local-lan-ip-address-of-server:8096
Starting Jellyfin container after installation
The first time Jellyfin is installed, the docker run command is used. However, docker run is for images. So, to rerun your container in case of a system restart (or hiccup), you’ll need to run the docker start command.
Using the docker ps -a command, view all containers on the system.
su -
docker ps -a
Look for the “CONTAINER ID” and find the Jellyfin container id. Then, you can start the container with the following docker start command.
docker start CONTAINER_ID
Alternatively, you can stop the container with docker stop.
docker stop CONTAINER_ID
Setting up Jellyfin
To set up Jellyfin, you must run the setup wizard. Then, follow the step-by-step instructions below.
Step 1: Read the “Welcome to Jellyfin!” message. Then, select the “Next” button to continue.
Step 2: Jellyfin will show you a “Tell us about yourself” page on the next page. From here, you must create an Admin username and a password.
For “Username,” enter “admin.” Then, select the “Next” button.
Step 3: You must now set up your media libraries. Select the “+” button next to the “Add Media Library” button. You’ll then need to select a content type. Types include movies, music, tv shows, photos, etc.
Be sure to select the /media
folder. This folder is in the Jellyfin container, not the host OS.
Step 4: To add media to Jellyfin, add files to the /media
folder on the host OS. The Jellyfin container will see these files on the host OS and pass them through. Ensure the folder has the correct permissions via the host OS with:
On the host OS, navigate to /media/ with the terminal, create a “movies” folder, a “tv” folder, and a “music” folder. Then, update the permissions of these folders so that Jellyfin can access them.
sudo chmod -R 777 /media/movies/ sudo chmod -R 777 /media/tv/ sudo chmod -R 777 /media/music/
Step 5: Place your on the Host OS, and place your media files in the “movies,” “tv,” and “music” folders. Then, complete the Jellyfin setup process to allow it to detect your media.
Using Jellyfin
To use Jellyfin, access the URL used for setup and select a movie, tv show, or music file to view. Alternatively, check out the Jellyfin website for information on the various apps available.