Learn how to Install Jellyfin Media Server on Ubuntu 22.04
Introduction
Requirements
The following is a list of items needed to complete the installation successfully:
1) A computer with atleast 4GB RAM, a dual core processor and 25GB of free disk space
2) Cloud servers: A domain name and a static IP addresses
3) An SSH client
4) A root or non root user with sudo priviledges
5) A stable internet connection
Overview
The following is an overview of the steps covered in this guide:
1) Update the system.
2) Download and install Jellyfin media server.
3) Configure Apache for Jellyfin.
4) Access the Jellyfin media server webadmin dashboard
5) Conclusion.
Step 1: Update the system
sudo apt update -yWhen the update process completes, run the command to upgrade system packages:
sudo apt upgrade -y
Step 2: Download and install Jellyfin media server
To install Jellyfin on Ubuntu, you need to follow the steps below:
Step 1: Add the Jellyfin official repository to APT.
Jellyfin is not included in the default Ubuntu repository, so you need to add the Jellyfin official repository to APT.
To do this, first, install the required dependencies by running the following command:
sudo apt update -y && sudo apt install apt-transport-https ca-certificates gnupg2 curl git -y
Next, create a directory for keyrings and download the Jellyfin GPG key inside that directory by running the following command:
sudo mkdir -p /etc/apt/keyrings sudo curl -fsSL https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/jellyfin.gpg
Then, add the Jellyfin repository to the APT file by running the following command:
echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release ) $( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release ) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list
Finally, update the repository index and install Jellyfin by running the following commands:
sudo apt update && sudo apt install jellyfin
Step 2: Check the status of Jellyfin.
After installing Jellyfin, you can check its status by running the following command:
systemctl status jellyfin
You will see the following output:
● jellyfin.service - Jellyfin Media Server Loaded: loaded (/lib/systemd/system/jellyfin.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/jellyfin.service.d └─jellyfin.service.conf Active: active (running) since Frday 2024-07-04 11:50:35 UTC; 30s ago Main PID: 45223 (jellyfin) Tasks: 20 (limit: 4579) Memory: 89.6M CPU: 6.525s CGroup: /system.slice/jellyfin.service └─45223 /usr/bin/jellyfin --webdir=/usr/share/jellyfin/web --restartpath=/usr/lib/jellyfin/restart.sh --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg Step 3: Check the ports used by Jellyfin. To check the ports used by Jellyfin, run the following command: sudo ss -tulpn | grep jellyfin You will see the following output: udp UNCONN 0 0 0.0.0.0:1900 0.0.0.0:* users:(("jellyfin",pid=45223,fd=316)) udp UNCONN 0 0 127.0.0.1:36964 0.0.0.0:* users:(("jellyfin",pid=45223,fd=318)) udp UNCONN 0 0 0.0.0.0:7359 0.0.0.0:* users:(("jellyfin",pid=45223,fd=331)) udp UNCONN 0 0 0.0.0.0:36634 0.0.0.0:* users:(("jellyfin",pid=45223,fd=317)) tcp LISTEN 0 512 0.0.0.0:8096 0.0.0.0:* users:(("jellyfin",pid=45223,fd=310))
Step 3: Configure Apache for Jellyfin
apt install apache2 -yStep 2: Enable Required Modules Next, enable all the required modules by running this command:
a2enmod proxy proxy_http ssl proxy_wstunnel remoteip http2 headersStep 3: Create Virtual Host Configuration Create an Apache virtual host configuration file by running this command in the terminal:
nano /etc/apache2/sites-available/jellyfin.confAdd the following configuration to the file:
ServerName jellyfin.example.com ErrorLog /var/log/apache2/jellyfin.example.com-error.log CustomLog /var/log/apache2/jellyfin.example.com-access.log combined DocumentRoot /var/www/html/jellyfin/public_html ProxyPreserveHost On # Tell Jellyfin to forward that requests came from TLS connections RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Forwarded-Port "443" ProxyPass "/socket" "ws://your-server-ip:8096/socket" ProxyPassReverse "/socket" "ws://your-server-ip:8096/socket" ProxyPass "/" "http://your-server-ip:8096/" ProxyPassReverse "/" "http://your-server-ip:8096/" ErrorLog /var/log/apache2/jellyfin.example.com-error.log CustomLog /var/log/apache2/jellyfin.example.com-access.log combinedOnce you have added the configuration, save and close the file. Step 4: Activate Jellyfin Virtual Host Activate the Jellyfin virtual host using this command:
a2ensite jellyfin.confStep 5: Verify Apache Configuration To verify the Apache configuration file, run the following command:
apachectl configtestIf there are no issues, you will see the following output:
Syntax OKStep 6: Restart Apache Service Finally, restart the Apache service to apply the changes using this command:
systemctl restart apache2You can check the Apache status using the following command:
systemctl status apache2
Step 4: Access the Jellyfin media server webadmin dashboard
To access the Jellyfin web interface, open your web browser and enter the URL http://jellyfin.example.com. This will take you to the Jellyfin welcome page.
Choose your preferred language and click on the “Next” button. Then, you will be directed to the user account creation page. Enter your desired admin username and password and click on “Next”. You will then be taken to the media library setup page. Add your media or click on “Next” if you don’t have any media to add. The next page will prompt you to select your metadata language and country.
Choose your language and country and click on “Next”. You will then be directed to the remote access configuration page. Click on “Next”. Once the setup is complete, you will see the following page. Click on “Finish”. You will then be taken to the Jellyfin login page. Enter your admin username and password and click on “Sign in”. This will take you to the Jellyfin dashboard on the following page.
Conclusion
Congratulations! You have successfully installed and configured the Jellyfin media server on your Ubuntu 22.04 system. Now you can access your media library from any device on your network or remotely from anywhere with an internet connection.
This guide covered the essential steps, including updating the system, adding the Jellyfin repository, installing the software, configuring Apache for reverse proxy, and finally, accessing the Jellyfin web interface for initial setup.
Remember to replace jellyfin.example.com with your actual domain name throughout the process for a smooth remote access experience. For further customization and advanced configuration options, refer to the official Jellyfin documentation. Happy streaming!