Jellyfin is a powerful open-source media server software that allows you to organize and stream your media collection. It’s a great alternative to commercial options like Plex, providing flexibility and privacy. If you’re looking to set up Jellyfin on Ubuntu 24.04, this guide will walk you through the installation process step-by-step.
Prerequisites
Before you begin, ensure you have:
- A system running Ubuntu 24.04.
- A user account with sudo privileges.
- Basic familiarity with the terminal.
Commands
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
wget –quiet -O – https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo tee /etc/apt/keyrings/jeyllyfin_team.gpg.key
sudo apt install apt-transport-https ca-certificates
systemctl status jellyfin
sudo nano /etc/nginx/conf.d/jellyfin.conf
=========================================================================
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; # Disable buffering when the nginx proxy gets very resource heavy upon streaming proxy_buffering off; } # location block for /web - This is purely for aesthetics so /web/#!/ works instead of having to go to /web/index.html/#!/ location ~ ^/web/$ { # Proxy main Jellyfin traffic 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 Jellyfin Websockets traffic 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; } # Security / XSS Mitigation Headers add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; }
===================================================================================
sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email you@example.com -d jellyfin.example.com