Jellyfin is a free software for setting up a media server. It allows you to collect, manage, and stream your media files from multiple devices or clients. Jellyfin is a free and self-hosted application that can be installed on your server. This allows you to set up your own media server in your local environment, e.g. at home, and then give multiple clients and devices access to all your media files.

Jellyfin is an alternative media file server to proprietary providers such as Emby and Plex. It allows you to manage media files from any device and from anywhere.

In this article, you will learn how to install and configure the Jellyfin Media Server on an Ubuntu 22.04 server and how to set up the basic installation of Jellyfin. We will also explain how to set up Apache2 as a reverse proxy for the Jellyfin application with secure HTTPS/SSL.

Prerequisites

For this tutorial you need the following prerequisites:

A Debian 11 server instance. This server must have a non-root user with sudo/administrator privileges.


A domain name pointing to the Debian server. This domain name will be used as the main domain for the Jellyfin installation.

Adding the Jellyfin repository

Jellyfin offers binary packages for several Linux distributions such as Debian, Ubuntu and CentOS. At the time of writing, Jellyfin provides a repository for two Debian versions, Debian Butser 10 and Debian Bullseye 11.

Before adding the Jellyfin repository, install the package dependencies using the“apt install” command below. Type Y to confirm the installation and press ENTER to start the installation.

sudo apt install apt-transport-https gnupg lsb-release

How do I set up Jellyfin Media Server under Debian linux

Now run the following command to add the Jellyfin GPG key and repository to your Debian server.

curl -fsSL https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/debian-jellyfin.gpg
echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/debian $( lsb_release -c -s ) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list

Finally, update the package index on your server with the“apt update” command to apply the new Jellyfin repository.

sudo apt update

How do I set up Jellyfin Media Server under Debian linux

Installing Jellyfin Media Server

At the time of writing, version 10.8 of the Jellyfin Media Server is available in the official Jellyfin repository.

To check the Jellyfin Media Server package, run the command“apt info“. This command will show you detailed information about the Jellyfin package, such as version, dependencies, APT source code repository and description.

sudo apt info jellyfin

How do I set up Jellyfin Media Server under Debian linux

To install the Jellyfin Media Server, run the command “apt install”. Enter Y to confirm the installation and press ENTER to start the installation of Jellyfin.

sudo apt install jellyfin

How do I set up Jellyfin Media Server under Debian linux

Make sure the Jellyfin service is running by running the“systemctl” command. You should see the output“enabled“, which means that the Jellyfin service is automatically started at system startup. Also, the current status of the Jellyfin service is“running“.

sudo systemctl is-enabled jellyfin
sudo systemctl status jellyfin

How do I set up Jellyfin Media Server under Debian linux

By default, Jellyfin runs on TCP port“8096“, which is used by the Jellyfin web application that provides the user interface for the Jellyfin Media Server. Since you will be using the Apache2 reverse proxy for the Jellyfin application, you do not need to open the default Jellyfin port.

Generate SSL Letsencrypt

To secure your Jellyfin Media Server installation, you will use the Apache2 reverse proxy and a secure HTTPS/SSL connection. However, before you set up the Apache2 reverse proxy, you need to generate the SSL certificates from Letsencrypt. You also need to make sure that the domain name of your Jellyfin installation points to the IP address of your Debian server.

If you are running the Debian server with the UFW firewall enabled, you should open the HTTP and HTTPS ports in your firewall configuration. Execute the“ufw” command below to allow the HTTP and HTTPS ports.

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

To generate SSL Letsencrypt, you need to install the client tool on your server. Install the certbot Letsencrypt tool with the“apt install” command below. Enter Y to confirm the installation and press ENTER.

sudo apt install certbot

Next, run the “certbot” command below to generate free SSL certificates from Letsencrypt. Don’t forget to change the email address and domain name.

sudo certbot certonly --standalone --noninteractive --agree-tos --email [email protected] -d jellyfin.hwdomain.io

Once the certbot process is complete, your SSL certificates will be available in the “https://vitux.com/etc/letsencrypt/live/jellyfin.hwdomain.io/” directory. You can use the file “fullchain.pem” as your public key and the file “privkey.pem” as your private SSL key.

Setting up Apache2 as a reverse proxy

After you have created SSL Letsencrypt, install and set up the Apache2 web server as a reverse proxy for the Jellyfin Media Server running on the default port “8096”. The Apache2 reverse proxy will run on the HTTP and HTTPS ports in front of the Jellyfin Media Server.

To install the Apache2 web server, run the command“apt install“. Confirm with Y and press ENTER to continue, then the installation will begin.

sudo apt install apache2

How do I set up Jellyfin Media Server under Debian linux

After the Apache installation is complete, run the following command to enable some Apache2 modules. These modules are required to set up the Apache2 reverse proxy.

sudo a2enmod proxy proxy_http ssl proxy_wstunnel remoteip http2

How do I set up Jellyfin Media Server under Debian linux

Next, create a new Apache2 virtual host configuration file “https://vitux.com/etc/apache2/sites-available/jellyfin.conf” with the following command.

sudo nano /etc/apache2/sites-available/jellyfin.conf

Add the following configuration to the file. Don’t forget to change the domain name and the path of the SSL certificates.

    ServerName jellyfin.hwdomain.io
# Comment to prevent HTTP to HTTPS redirect
Redirect permanent / https://jellyfin.hwdomain.io

ErrorLog /var/log/apache2/jellyfin.hwdomain.io-error.log
CustomLog /var/log/apache2/jellyfin.hwdomain.io-access.log combined


# If you are not using a SSL certificate, replace the 'redirect'
# line above with all lines below starting with 'Proxy'


ServerName jellyfin.hwdomain.io
# This folder exists just for certbot(You may have to create it, chown and chmod it to give apache permission to read it)
DocumentRoot /var/www/html/jellyfin/public_html

ProxyPreserveHost On

# Letsencrypt's certbot will place a file in this folder when updating/verifying certs
# This line will tell apache to not to use the proxy for this folder.
ProxyPass "https://vitux.com/.well-known/" "!"

ProxyPass "https://vitux.com/socket" "ws://192.168.5.10:8096/socket"
ProxyPassReverse "https://vitux.com/socket" "ws://192.168.5.10:8096/socket"

ProxyPass "https://vitux.com/" "http://192.168.5.10:8096/"
ProxyPassReverse "https://vitux.com/" "http://192.168.5.10:8096/"

SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/jellyfin.hwdomain.io/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/jellyfin.hwdomain.io/privkey.pem
Protocols h2 http/1.1

# Enable only strong encryption ciphers and prefer versions with forwarding Secrecy
SSLCipherSuite HIGH:RC4-SHA:AES128-SHA:!aNULL:!MD5
SSLHonorCipherOrder on

# Disable insecure SSL and TLS versions
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1

ErrorLog /var/log/apache2/jellyfin.hwdomain.io-error.log
CustomLog /var/log/apache2/jellyfin.hwdomain.io-access.log combined

Save and close the file when you are finished.

Next, activate the virtual host configuration file“jellyfin.conf” with the following command. Check and verify the Apache2 configuration with the“apachectl” command. The first command creates a new shortcut file of the“jellyfin.conf” to the Apache Virtual Host directory“sites-enabled” and the second command checks all Apache configuration files. If your Apache configuration files are correct, you will see the message“Syntax OK“.

sudo a2ensite jellyfin.conf
sudo apachectl configtest

Finally, restart the Apache2 service to apply the new virtual host file “jellyfin.conf” using the“systemctl” command below.

sudo systemctl restart apache2

How do I set up Jellyfin Media Server under Debian linux

Jellyfin installation and configuration

The installation of the Jellyfin Media Server with Apache2 Reverse Proxy and SSL Letsencrypt is now complete. It is now time to set up your Jellyfin Media Server installation.

Open your web browser and go to the domain name of your Jellyfin Media Server installation (e.g.: https://jellyfin.hwdomain.io/).

On the first screen of the installation wizard, select the language for your Jellyfin Media Server. Then click on“Next“.

How do I set up Jellyfin Media Server under Debian linux

Enter a new admin user and a password. Then click on “Next“. This user will be used as the default admin for Jellyfin Media Server.

How do I set up Jellyfin Media Server under Debian linux

Click the“Add Media Library” button to add a new library for your media files. You can add multiple libraries at once. You can also make some additional settings for your libraries.

How do I set up Jellyfin Media Server under Debian linux

Select the‘Content type‘ of your media library. Then enter the name of the library. Then click on the ‘ button to add the path to your media library. Now confirm with“OK“.

In this demo, we will create a new media library of the type“Music” with the name“Music” and the path of the library files will be in the directory“https://vitux.com/mnt/media/Musics“.

How do I set up Jellyfin Media Server under Debian linux

Click on the“Next” button to continue.

How do I set up Jellyfin Media Server under Debian linux

For the“Metadata language“, you can leave it at the default setting and click“Next“.

How do I set up Jellyfin Media Server under Debian linux

To enable remote access, check the option“Allow remote connections to this Jellyfin server”. Then click“Next” again. This option is useful if you have remote clients such as smartphones or SmartTV.

How do I set up Jellyfin Media Server under Debian linux

Once the installation is complete, you will see the page with the message“You’re Done!“. Click on the“Finish” button.

How do I set up Jellyfin Media Server under Debian linux

You will now see the login page for the Jellyfin Media Server. Enter your admin user and password and click on the“Login” button. You should now see the admin dashboard of your Jellyfin Media Server.

How do I set up Jellyfin Media Server under Debian linux

How do I set up Jellyfin Media Server under Debian linux

Conclusion

Congratulations! You have installed the Jellyfin Media Server on Debian 11 Bullseye. You have also secured the installation of the Jellyfin Media Server with the Apache2 Reverse Proxy and HTTPS/SSL from Letsencrypt. You should now be able to add media files such as music, videos, images and others to your Jellyfin Media Server. Then you can install the client application on your phone or use a web browser if you are using a computer.