In the digital age, streaming your favorite movies, TV shows, and music has never been easier. Among the myriad of solutions available, Jellyfin stands out as a powerful open-source media server that allows you to manage and access your media library effortlessly. This guide will walk you through the steps to set up Jellyfin on an Ubuntu system, ensuring you enjoy a seamless streaming experience. Let’s dive in and explore how to turn your Ubuntu machine into a personal media server.

System Preparation and Requirements

Before you start, ensure your system meets the following requirements: a supported Ubuntu version (20.04, 22.04, or 24.04), a stable internet connection, and administrative access. Keeping your system updated is crucial as it minimizes compatibility issues and applies essential security patches, ensuring a smoother server deployment.

To get started, update your system packages to the latest versions to reduce dependency conflicts and address known vulnerabilities:

sudo apt update && sudo apt upgrade -y

Next, install essential dependencies that will help download packages securely and manage necessary repositories:

sudo apt install curl apt-transport-https ca-certificates software-properties-common -y

Adding the Jellyfin Repository and GPG Key

Since Jellyfin is not included in the official Ubuntu repositories, you’ll need to add its repository along with the GPG key to verify the authenticity of the packages. Start by importing the Jellyfin GPG key:

curl -fsSL https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/jellyfin.gpg

Now, add the Jellyfin repository to your system’s sources list (remember to replace “noble” with your specific Ubuntu codename if necessary):

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

Finally, update the package index to include the newly added Jellyfin repository:

sudo apt update

Installing and Starting Jellyfin

READ 👉  How to Fix Dual-Boot Issues Between Ubuntu and Windows

Now it’s time to install the Jellyfin server package, which will also install necessary dependencies such as jellyfin-ffmpeg for media transcoding:

sudo apt install jellyfin -y

Ensure the Jellyfin service is enabled to start automatically at boot:

sudo systemctl enable jellyfin
sudo systemctl start jellyfin

To verify that Jellyfin is running correctly, check its status:

1sudo systemctl status jellyfin

Configuring Firewall and Network Access

Jellyfin runs on port 8096 by default. If you have UFW (Uncomplicated Firewall) enabled, you need to allow traffic on this port:

sudo ufw allow 8096/tcp

For other firewall types, like Firewalld, execute the following commands:

sudo firewall-cmd --permanent --add-port=8096/tcp
sudo firewall-cmd --reload

Initial Web Interface Setup

Once everything is running, access the Jellyfin web interface to complete the setup. On any device connected to your network, open your browser and go to:

http://your_server_ip:8096

Remember to replace “your_server_ip” with the actual IP address of your server. The Jellyfin setup wizard will pop up, guiding you through several steps:

  1. Language Preferences: Choose your preferred display and metadata languages.
  2. Administrator Account: Create a username and secure password—it’s essential to use a strong password combining upper/lowercase letters, numbers, and symbols.
  3. Media Libraries: Define your media library locations by adding content types like Movies, TV Shows, or Music, and specify the paths to your media files.
  4. Metadata Settings: Configure metadata preferences to enhance information accuracy and relevance.
  5. Remote Access: If you wish to stream outside your local network, enable “Allow remote connections” and “Automatic port mapping.” For a more secure connection, consider setting up a reverse proxy with HTTPS.

Once you finish these steps, log in with your administrator credentials to access the Jellyfin dashboard, where you can see your media libraries and available plugins.

READ 👉  Blue Recorder Review – Best Lightweight Screen Recorder for Linux

Assigning Media Directory Permissions

For Jellyfin to access your media files, it requires appropriate permissions. If your media files are stored outside your home directory, you need to set up permissions using setfacl:

  1. First, install the ACL package if it’s not already installed: sudo apt install acl
  2. Grant the Jellyfin user necessary permissions for your media directory: sudo setfacl -R -m u:jellyfin:rx /media/mymediadrive

For individual subfolders or files, adjust permissions accordingly:

sudo setfacl -m u:jellyfin:rx /media/mymediadrive/specific-folder

Reverse Proxy and HTTPS (Optional for Remote Access)

For secure external access, consider deploying a reverse proxy using Nginx or Apache and obtaining a TLS certificate from Let’s Encrypt. This will encrypt your traffic and allow you to access Jellyfin using a custom domain.

Nginx Reverse Proxy Example

  1. Install Nginx: sudo apt install nginx
  2. Create a new Nginx configuration file: sudo nano /etc/nginx/conf.d/jellyfin.conf
  3. Add the server block configuration, replacing “jellyfin.example.com” with your domain: 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"; }
    }
  4. Test and reload Nginx: sudo nginx -t sudo systemctl reload nginx
  5. Acquire a free TLS certificate: 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

If you prefer Apache, the steps are similar:

  1. Install Apache: sudo apt install apache2
  2. Enable necessary Apache modules: sudo a2enmod proxy proxy_http headers proxy_wstunnel
  3. Create your site configuration: sudo nano /etc/apache2/sites-available/jellyfin.conf
  4. Insert the following configuration, as with Nginx: <VirtualHost *:80> ServerName jellyfin.example.com ProxyPass / http://localhost:8096/ ProxyPassReverse / http://localhost:8096/ </VirtualHost>
  5. Enable the site configuration and restart Apache: sudo a2ensite jellyfin.conf 2sudo systemctl restart apache2
  6. Obtain a TLS certificate for secure access: sudo apt install python3-certbot-apache sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email you@example.com -d jellyfin.example.com

Conclusion

READ 👉  Etcher – Easily Create Bootable USB Drives and SD Cards (Windows, Linux, macOS)

Setting up a media server with Jellyfin on Ubuntu opens the door to an incredible media management experience, enabling you to stream your favorite content from any device. Whether you’re creating a personal library or sharing with friends and family, these clear steps will guide you through the process. With your server running smoothly, you can now enjoy personalized entertainment anytime and anywhere. Dive into the world of Jellyfin and make the most of your media collection!

Did you enjoy this article? Feel free to share it on social media and subscribe to our newsletter so you never miss a post!

And if you'd like to go a step further in supporting us, you can treat us to a virtual coffee ☕️. Thank you for your support ❤️!
Buy Me a Coffee

Categorized in: