Jellyfin is a free and open-source media server that lets you organize and stream your movies, TV shows, music, and photos to various devices on your network or over the Internet. It can be installed on Linux, MacOS, and Windows systems. This guide explains how to install Jellyfin on Ubuntu 24.04 LTS.
Jellyfin Features
Jellyfin is derived from Emby media server, offering similar functionalities as Plex and Emby. Key features include:
- Completely free and open-source, unlike Plex or Emby. No ads or playback limitations on mobile apps (though the iOS app may not support background video playback).
- Live TV and automated recording capabilities to expand your media library.
- Automatic fetching of artwork and metadata from sources like TheTVDB, TheMovieDB, The Open Movie Database, and Rotten Tomatoes.
- DLNA support.
- Optional plugins for added functionality.
- Hardware acceleration for video encoding/decoding using FFMpeg.
Installing Jellyfin Media Server on Ubuntu 24.04
Jellyfin isn’t included in the default Ubuntu repositories, so you’ll need to add its repository to your system.
Step 1: Add the Jellyfin repository to your Ubuntu system.
echo "deb [signed-by=/etc/apt/keyrings/jeyllyfin_team.gpg.key arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list
Step 2: Import the Jellyfin GPG key so APT can verify package integrity during installation.
wget --quiet -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo tee /etc/apt/keyrings/jeyllyfin_team.gpg.key
Step 3: Install the apt-transport-https
and ca-certificates
packages, as the repository uses HTTPS.
sudo apt install apt-transport-https ca-certificates
Step 4: Update the package index and install Jellyfin.
sudo apt update
sudo apt install jellyfin
This command also installs the following dependency packages:
jellyfin-ffmpeg6
: For video transcoding.jellyfin-server
: The back-end server.jellyfin-web
: The front-end web interface.
Step 5: Check the status of the Jellyfin service.
systemctl status jellyfin
If Jellyfin isn’t running, start it with:
sudo systemctl start jellyfin
Jellyfin Media Server Initial Setup
Access the web-based management interface by navigating to port 8096
on your server’s IP address. For example:
http://127.0.0.1:8096
or
http://127.0.0.1:8096/web
If you’ve installed Jellyfin on a remote Ubuntu server, you’ll need to set up a reverse proxy with Nginx or Apache to access the web UI.
Step 1: Choose your preferred language.
Step 2: Create a user account.
Step 3: Add media libraries by clicking the Add Media Library
button.
Step 4: Select a content type (movies, music, TV shows, etc.) and a display name.
Step 5: Click the Plus (+) button to select the folder containing your media.
The jellyfin
user must have read and execute permissions on your media directories. For external drives mounted under /media/
, you may need to adjust permissions. Here’s how to grant the necessary permissions using setfacl
:
sudo setfacl -m u:jellyfin:rx /media/<user>/<drive_name>/
Replace <user>
with your username and <drive_name>
with the name of your external drive. You may also need to assign permissions to individual media directories.
sudo setfacl -m u:jellyfin:rx /media/<user>/<drive_name>/<directory_name>
Adding the recursive flag (-R
) grants the jellyfin
user read and execute permission on every file and sub-directory on the drive.
sudo setfacl -R -m u:jellyfin:rx /media/<user>/<drive_name>/
This is suitable if the drive is exclusively used for media files. However, avoid doing this if the drive contains sensitive data.
Step 6: Configure library settings, selecting your language and country.
Step 7: Click Ok
and Next
. You can add more libraries later.
Step 8: Choose whether to enable remote access. Disabling the native remote access method is recommended because it lacks HTTPS encryption. If remote access is needed, set up a reverse proxy.
Step 9: Click Next
and Finish
. Log in to your Jellyfin account.
Redoing the Initial Setup
If you make a mistake during the initial setup, you can restart the process:
Step 1: Edit the Jellyfin configuration file:
sudo nano /etc/jellyfin/system.xml
Step 2: Change the following line:
<IsStartupWizardCompleted>true</IsStartupWizardCompleted>
to:
<IsStartupWizardCompleted>false</IsStartupWizardCompleted>
Step 3: Save the file and restart Jellyfin.
sudo systemctl restart jellyfin
Visiting localhost:8096/web
will now display the setup wizard again.
Setting Up Reverse Proxy
Since Jellyfin listens on 127.0.0.1:8096
, the web interface is only accessible from the same computer. To enable access from a remote computer, set up a reverse proxy with Nginx or Apache.
Method 1: Nginx
Nginx is a web server and reverse proxy.
Step 1: Install Nginx.
sudo apt install nginx
Step 2: Create a server block file for Jellyfin.
sudo nano /etc/nginx/conf.d/jellyfin.conf
Step 3: Add the following content to the file, replacing jellyfin.example.com
with your domain name. Create a DNS A record for this subdomain.
server {
listen 80;
listen [::]:80;
server_name jellyfin.example.com;
access_log /var/log/nginx/jellyfin.access;
error_log /var/log/nginx/jellyfin.error;
set $jellyfin 127.0.0.1;
location / {
proxy_pass http://127.0.0.1:8096;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_buffering off;
}
location ~ ^/web/$ {
proxy_pass http://$jellyfin:8096/web/index.html;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
location /socket {
proxy_pass http://127.0.0.1:8096;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
}
Step 4: Test the Nginx configuration.
sudo nginx -t
Step 5: If the test is successful, reload Nginx.
sudo systemctl reload nginx
You can now access Jellyfin via jellyfin.example.com
or jellyfin.example.com/web/index.html
for the initial setup wizard.
Method 2: Apache
If you prefer Apache, use the following instructions.
Step 1: Install Apache.
sudo apt install apache2
Step 2: Enable the proxy
modules and the header
module.
sudo a2enmod proxy proxy_http headers proxy_wstunnel
Step 3: Create a virtual host file for Jellyfin.
sudo nano /etc/apache2/sites-available/jellyfin.conf
Step 4: Add the configurations, replacing jellyfin.example.com
with your domain name. Create a DNS A record for this subdomain.
<VirtualHost *:80>
ServerName jellyfin.example.com
ErrorDocument 404 /404.html
ProxyPass / http://localhost:8096/
ProxyPassReverse / http://localhost:8096/
SSLProxyEngine on
<Location /:/websockets/notifications>
ProxyPass wss://localhost:8096/:/websockets/notifications
ProxyPassReverse wss://localhost:8096/:/websockets/notifications
</Location>
Header always unset X-Frame-Options
</VirtualHost>
Step 5: Enable the virtual host.
sudo a2ensite jellyfin.conf
Step 6: Restart Apache.
sudo systemctl restart apache2
Jellyfin is now accessible via jellyfin.example.com
or jellyfin.example.com/web/index.html
for the initial setup.
How to Enable HTTPS
Encrypt HTTP traffic by enabling HTTPS with a free TLS certificate from Let’s Encrypt.
Step 1: Install the Let’s Encrypt client (certbot).
sudo apt install certbot
Step 2: Install the Certbot plugin for Nginx or Apache, depending on your web server.
For Nginx:
sudo apt install python3-certbot-nginx
For Apache:
sudo apt install python3-certbot-apache
Step 3: Obtain and install the TLS certificate.
For Nginx:
sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email you@example.com -d jellyfin.example.com
For Apache:
sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email you@example.com -d jellyfin.example.com
Where:
--nginx
: Use the Nginx plugin.--apache
: Use the Apache plugin.--agree-tos
: Agree to terms of service.--redirect
: Force HTTPS by 301 redirect.--hsts
: Add the Strict-Transport-Security header to every HTTP response.--staple-ocsp
: Enables OCSP Stapling.
The certificate should now be installed automatically.
Jellyfin is now accessible via HTTPS at https://jellyfin.example.com
.
How to Upgrade Jellyfin on Ubuntu 24.04
Upgrade Jellyfin when a new version is released.
Step 1: Update the package index.
sudo apt update
Step 2: Upgrade installed packages.
sudo apt upgrade
Step 3: Restart Jellyfin.
sudo systemctl restart jellyfin
Troubleshooting Tips
Invalid Signature
If you encounter the following error when running sudo apt update
:
The following signatures were invalid: EXPKEYSIG 49023CD01DE21A7B Jellyfin Team <team@jellyfin.org>
Re-import the Jellyfin public key.
wget --quiet -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo tee /etc/apt/keyrings/jeyllyfin_team.gpg.key
Hopefully, this guide helped you set up Jellyfin on Ubuntu 24.04 so you can enjoy your media collection.