Jellyfin transforms an Ubuntu machine into a centralized media server, allowing you to stream movies, TV shows, music, and photos to nearly any device on your network. By installing Jellyfin, you retain full control over your media library without subscription fees or third-party tracking, and you can expand functionality with plugins and remote access options.
System Preparation and Requirements
Jellyfin requires an Ubuntu system (20.04, 22.04, or 24.04 recommended), a reliable internet connection, and administrative access. Ensuring your system is up-to-date prevents compatibility issues and applies critical security patches before server deployment.
Step 1: Update all system packages to their latest versions. This step minimizes the risk of dependency conflicts and closes known security vulnerabilities.
sudo apt update && sudo apt upgrade -y
Step 2: Install essential dependencies, including curl
, apt-transport-https
, ca-certificates
, and software-properties-common
. These utilities are required for securely downloading packages and managing repositories.
sudo apt install curl apt-transport-https ca-certificates software-properties-common -y
Adding the Jellyfin Repository and GPG Key
Official Ubuntu repositories do not include Jellyfin, so you must add the Jellyfin repository and its GPG key. This ensures that your server downloads authentic Jellyfin packages and receives updates directly from the maintainers.
Step 3: Import the Jellyfin GPG key to verify package integrity. The method varies slightly by distribution version, but the following is broadly compatible:
curl -fsSL https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/jellyfin.gpg
Step 4: Add the Jellyfin repository to your system’s sources list. Replace noble
with your Ubuntu codename if necessary (e.g., jammy
for 22.04):
echo "deb [signed-by=/usr/share/keyrings/jellyfin.gpg] https://repo.jellyfin.org/ubuntu noble main" | sudo tee /etc/apt/sources.list.d/jellyfin.list
Step 5: Update the package index to include the new Jellyfin repository.
sudo apt update
Installing and Starting Jellyfin
Step 6: Install the Jellyfin server package. This command will also install required dependencies such as jellyfin-ffmpeg
for media transcoding.
sudo apt install jellyfin -y
Step 7: Enable and start the Jellyfin service so it runs automatically at boot. This ensures your media server is always available after restarts.
sudo systemctl enable jellyfin
sudo systemctl start jellyfin
Step 8: Verify that Jellyfin is running correctly. Look for Active: active (running)
in the output.
sudo systemctl status jellyfin
Configuring Firewall and Network Access
Jellyfin uses port 8096 by default for HTTP traffic. If you have a firewall enabled (such as UFW), you must allow traffic on this port to access the web interface from other devices.
Step 9: Open port 8096 in UFW to permit local network access to Jellyfin.
sudo ufw allow 8096/tcp
If you use a different firewall, such as firewalld
, add the port accordingly:
sudo firewall-cmd --permanent --add-port=8096/tcp
sudo firewall-cmd --reload
Initial Web Interface Setup
Once the server is running, configure Jellyfin through its web interface. This setup process includes creating an administrator account, specifying media library locations, and choosing metadata preferences.
Step 10: Open a web browser on any device on your network and navigate to:
http://your_server_ip:8096
Replace your_server_ip
with the actual IP address of your Ubuntu server. The Jellyfin setup wizard will appear.
Step 11: Select your preferred display language and metadata language. Click Next to proceed.
Step 12: Create an administrator username and a strong password. This account manages users, libraries, and server settings. Use a password that combines uppercase, lowercase, numbers, and symbols for security.
Step 13: Define your media libraries. Click Add Media Library, select the content type (Movies, TV Shows, Music, etc.), and enter the path to your media files. You can add multiple libraries or folders as needed.
Step 14: Adjust metadata settings, such as preferred language and country, to improve media information accuracy.
Step 15: Configure remote access if you want to stream media outside your local network. Enable "Allow remote connections" and "Automatic port mapping" if your router supports UPnP. For secure remote access, consider setting up a reverse proxy with HTTPS (see below).
Step 16: Complete the setup and sign in with your admin account. The Jellyfin dashboard will display your media libraries and available plugins.
Assigning Media Directory Permissions
Jellyfin must have read and execute permissions on your media directories. If your media is stored outside your home directory (e.g., on an external drive or network share), adjust permissions using setfacl
for fine-grained control.
Step 17: Install the ACL package if it's not already present:
sudo apt install acl
Step 18: Grant the Jellyfin user permission to access your media directory. Replace /media/mymediadrive
with your actual media path:
sudo setfacl -R -m u:jellyfin:rx /media/mymediadrive
If you need to assign permissions to individual subfolders or files, use:
sudo setfacl -m u:jellyfin:rx /media/mymediadrive/specific-folder
Reverse Proxy and HTTPS (Optional for Remote Access)
To securely access Jellyfin from outside your local network, deploy a reverse proxy using Nginx or Apache and obtain a TLS certificate from Let’s Encrypt. This setup encrypts your traffic and enables access via a custom domain.
Nginx Reverse Proxy Example
sudo apt install nginx
sudo nano /etc/nginx/conf.d/jellyfin.conf
Add a server block referencing your domain. Replace jellyfin.example.com
with your actual domain name:
server {
listen 80;
server_name jellyfin.example.com;
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;
}
location /socket {
proxy_pass http://127.0.0.1:8096/socket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Test and reload Nginx:
sudo nginx -t
sudo systemctl reload nginx
Acquire a free TLS certificate with Certbot:
sudo apt install python3-certbot-nginx
sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email you@example.com -d jellyfin.example.com
Apache Reverse Proxy Example
sudo apt install apache2
sudo a2enmod proxy proxy_http headers proxy_wstunnel
sudo nano /etc/apache2/sites-available/jellyfin.conf
Insert the following configuration (replace domain as needed):
<VirtualHost *:80>
ServerName jellyfin.example.com
ProxyPass / http://localhost:8096/
ProxyPassReverse / http://localhost:8096/
</VirtualHost>
Enable the site and restart Apache:
sudo a2ensite jellyfin.conf
sudo systemctl restart apache2
Obtain a TLS certificate for Apache:
sudo apt install python3-certbot-apache
sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email you@example.com -d jellyfin.example.com
Jellyfin on Ubuntu delivers a robust, private streaming solution for your home or small office, with flexible configuration options and strong community support. Regularly update your server and Jellyfin installation to maintain security and access the latest features.
Member discussion