Jellyfin Media Server

How to Install Jellyfin on Ubuntu 24.04 (Production Setup)

Go beyond the basics. Deploy a secure, production-ready private Netflix with Nginx, SSL, and GPU Transcoding.

The Reality of Self-Hosted Media

Let's be brutally honest: Yes, you can install Jellyfin on an old laptop or a Raspberry Pi. If you are the only user watching 1080p movies on your local network, that is completely fine.

But what happens when you share your server with 5 friends? What happens when you try to stream a 50GB 4K movie while traveling on mobile data? Your old laptop will crash, and the stream will buffer endlessly.

To build a true, production-grade Netflix Alternative, you need three things:

  • Bare Metal Power: Unshared network and compute resources.
  • Hardware Transcoding (GPU): To compress 4K video to mobile resolutions on the fly.
  • Security (HTTPS): A Reverse Proxy so your data isn't exposed over HTTP.

This tutorial skips the "beginner" stuff and shows you how SysAdmins deploy Jellyfin professionally.

Step 1: Docker & Firewall Setup

Start by updating your ServerMO Dedicated Server and installing Docker.

sudo apt update && sudo apt upgrade -y
sudo apt install docker.io docker-compose ufw -y
sudo systemctl enable --now docker

Security First: Never deploy a server without configuring the firewall. We need ports 80 and 443 for our Reverse Proxy (SSL), and 8096 temporarily for Jellyfin testing.

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 8096/tcp
sudo ufw enable

Step 2: Media Organization & Permissions

Don't just dump all files into one folder. A proper library structure prevents scanning errors.

mkdir -p ~/jellyfin/{config,cache,media}
mkdir -p ~/jellyfin/media/{Movies,Shows,Music}
cd ~/jellyfin

Understanding User Permissions (1000:1000)

In our Docker config below, you will see user: 1000:1000. This maps the container's user to your host OS user. Find your actual UID and GID by typing id in the terminal. If yours is different (e.g., 1001), change it in the config! Otherwise, Jellyfin won't have permission to read your media files.

Step 3: The Production Docker Compose

This isn't a basic compose file. We are adding Hardware Transcoding (passing the GPU to the container) and mapping a RAM Disk (tmpfs) for transcoding caches to save your SSD's lifespan.

Crucial Step: GPU Group Permissions & NVIDIA Config

Many basic tutorials only map /dev/dri, causing silent transcoding failures due to Linux permission restrictions. You must find your server's render group ID (usually 109) by running: getent group render | cut -d: -f3 and declare it via group_add.

Furthermore, if your Bare Metal server utilizes an NVIDIA GPU (e.g., RTX 4090 or L40S), standard device mapping is insufficient. You must utilize the deploy: configuration block detailed below.

nano docker-compose.yml

Paste the following configuration into the editor:

version: '3.8'
services:
  jellyfin:
    image: jellyfin/jellyfin:latest
    container_name: jellyfin
    user: 1000:1000
    # CRITICAL for Intel/AMD GPU: Add the render group ID here (e.g., 109)
    group_add:
      - "109"
    network_mode: 'host'
    volumes:
      - ./config:/config
      - ./cache:/cache
      - ./media:/media
    # Performance Tuning: RAM Disk for Transcoding
    tmpfs:
      - /transcode
    
    # --- HARDWARE TRANSCODING: INTEL / AMD ---
    devices:
      - /dev/dri:/dev/dri
      
    # --- HARDWARE TRANSCODING: NVIDIA ONLY (Uncomment below) ---
    # deploy:
    #   resources:
    #     reservations:
    #       devices:
    #         - driver: nvidia
    #           count: 1
    #           capabilities: [gpu]

    restart: 'unless-stopped'

Start the engine:

sudo docker-compose up -d

Step 4: Nginx Reverse Proxy & HTTPS (SSL)

Never leave your streaming server on plain HTTP. We will use Nginx to route traffic securely and Certbot for free SSL.

sudo apt install nginx certbot python3-certbot-nginx -y

Create an Nginx configuration file for your domain (e.g., media.yourdomain.com):

sudo nano /etc/nginx/sites-available/jellyfin

Paste the basic routing block:

server {
    listen 80;
    server_name media.yourdomain.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;
        proxy_set_header X-Forwarded-Protocol $scheme;
        proxy_set_header X-Forwarded-Host $http_host;

        # Disable buffering for smooth streaming
        proxy_buffering off;
    }
    
    # Websockets support
    location /socket {
        proxy_pass http://127.0.0.1:8096;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Enable the site and apply the SSL certificate:

sudo ln -s /etc/nginx/sites-available/jellyfin /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d media.yourdomain.com

Step 5: Maintenance (Updates & Backups)

In a production environment, you need a strategy for updates and backups.

To update Jellyfin automatically: Navigate to your directory and pull the latest image.

cd ~/jellyfin
sudo docker-compose pull
sudo docker-compose up -d

Backup Strategy: Your media files are safe on your disk. But if your server crashes, you don't want to lose your watch history and user accounts. Set up a cron job to automatically backup the ~/jellyfin/config folder to cloud storage regularly.

Conclusion: Scale Your Streaming Empire

You have successfully deployed a completely secure, hardware-accelerated, production-ready media server.

    Is your hardware holding you back?

  • Heavy Transcoding? You need a Bare Metal server with an NVIDIA GPU or Intel QuickSync.
  • Huge 4K Library? You need dedicated Enterprise NVMe or massive HDD arrays.
  • Multiple Remote Users? You need an Unmetered 1Gbps Dedicated Port to prevent buffering.
Don't compromise on streaming quality.

Deploy a high-performance Dedicated GPU or Storage Server with ServerMO today and take complete control of your entertainment.

Jellyfin FAQ (The Uncensored Truth)

Do I really need a GPU for Jellyfin?

Let's be transparent: If you are watching media on your Smart TV at home in its original quality (Direct Play), a strong CPU is perfectly fine. However, if you want to watch a 4K movie on your phone using mobile data, Jellyfin must compress that video to 720p instantly. This is called Hardware Transcoding. A standard CPU will choke and cause endless buffering. For remote streaming, an NVIDIA GPU or Intel QuickSync is mandatory.

Why shouldn't I just use a cheap NAS or old laptop?

A home NAS is great for local storage. But home internet connections usually have terrible "Upload Speeds". When you share your server with friends, your home upload speed becomes the bottleneck. A ServerMO Dedicated Server provides a 1Gbps symmetric connection, meaning 1000Mbps upload speed for flawless remote streaming.

How do I monitor my server's performance?

For production environments, SysAdmins use tools like Prometheus and Grafana to monitor CPU, RAM, and bandwidth usage in real-time. For a simpler setup, you can install Uptime Kuma to get Telegram alerts if your Jellyfin server goes offline.

Ready to Launch with Unmatched Power?

Ready to Launch with Unmatched Power? Deploy blazing-fast 1–100Gbps unmetered servers, high-performance GPU rigs, or game-optimized hosting custom-built for speed, reliability, and scale. Whether it’s colocation, compute-intensive tasks, or latency-critical applications, ServerMO delivers. Order now and get online in minutes, fully secured, fully optimized.

Red and white text reads '24x7' above bold purple 'SERVICES' on a white background, all set against a black backdrop. Energetic and modern feel.

Power. Performance. Precision.

99.99% Uptime Guarantee
24/7 Expert Support
Blazing-Fast NVMe SSD

Christmas Mega Sale!

Unwrap the ultimate power! Get massive holiday discounts on all Dedicated Servers. Offer ends soon grab yours before the snow melts!

London UK (15% OFF)
Tokyo Japan (10% OFF)
00Days
00Hrs
00Min
00Sec
Explore Grand Offers