How to Install Jellyfin with Docker on Rocky Linux 8

Install Jellyfin with Docker on Rocky Linux 8 behind Nginx and HTTPS, with persistent media storage, firewalld rules, SELinux labels, and fixes.
A 3D Rocky Linux media server with glowing container modules and blue streaming trails on a midnight-blue background.

Install Jellyfin with Docker on Rocky Linux 8 and reach your media library through a protected HTTPS address. This setup takes roughly 15 minutes on a clean VPS and leaves Jellyfin’s unencrypted port private behind Nginx.

Prerequisites

  • A 64-bit Rocky Linux 8 server with at least 2 GB of RAM, 20 GB of free system disk, and separate storage for your movies, music, or photos.
  • SSH access as root, or a normal account that can run commands with sudo.
  • A DNS A record such as YOUR_DOMAIN pointing to SERVER_IP; Let’s Encrypt needs the name to resolve publicly.
  • Provider-level inbound access for TCP ports 80 and 443. Firewalld will allow those ports locally; port 8096 will remain loopback-only.
  • A VPSLake Linux VPS if you need a Rocky Linux server with root access.

These instructions install Docker Engine, the Compose plugin, Nginx, and Certbot. If you are already logged in as root, remove sudo from each command.

Step 1: Install Docker Engine on Rocky Linux 8

Rocky Linux 8 uses DNF, and Docker’s RHEL repository supplies the Engine packages needed on this compatible Enterprise Linux release.

Check the host before changing packages, then install Docker from its official RPM repository:

grep -E '^(PRETTY_NAME|VERSION_ID|ID_LIKE)=' /etc/os-release
uname -m
sudo dnf remove -y docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine podman runc
sudo dnf install -y dnf-plugins-core ca-certificates
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker

The removal line is suitable for a new VPS where Podman or an older Docker installation is not hosting workloads. Do not remove those packages from an existing production host until you have migrated its containers. Docker documents this repository method in its RHEL installation guide.

Verify the daemon, Compose plugin, and a disposable test container:

sudo systemctl is-active docker
sudo docker version --format 'Client {{.Client.Version}} / Server {{.Server.Version}}'
sudo docker compose version
sudo docker run --rm hello-world

Expected output contains an active service, Docker version strings, a Compose version, and the test image’s confirmation message:

active
Client X.Y.Z / Server X.Y.Z
Docker Compose version v2.X.Y
Hello from Docker!

Exact version numbers will change as the repositories publish updates.

Step 2: Create storage for Jellyfin

Keeping the application data on the host means a recreated container does not lose its users, metadata, database, or cache.

Create private directories for configuration and cache, plus a media directory that the container will mount read-only:

sudo install -d -m 0750 /srv/jellyfin/config
sudo install -d -m 0750 /srv/jellyfin/cache
sudo install -d -m 0750 /srv/jellyfin/media
sudo install -d -m 0750 /opt/jellyfin

Copy your library into /srv/jellyfin/media or mount a larger disk there. The files must be readable by the container, and every parent directory needs execute permission. Docker’s :Z mount option in the next step applies a private SELinux label to these paths.

Step 3: Run the Jellyfin container

Compose records the port binding, restart behavior, and SELinux-aware mounts so the service can be recreated consistently.

Write the Compose file:

sudo tee /opt/jellyfin/compose.yaml >/dev/null <<'EOF'
services:
  jellyfin:
    image: jellyfin/jellyfin:latest
    container_name: jellyfin
    ports:
      - "127.0.0.1:8096:8096"
    volumes:
      - "/srv/jellyfin/config:/config:Z"
      - "/srv/jellyfin/cache:/cache:Z"
      - "/srv/jellyfin/media:/media:ro,Z"
    restart: unless-stopped
EOF

Validate the file, fetch the official image, and start Jellyfin:

sudo docker compose -f /opt/jellyfin/compose.yaml config --quiet
sudo docker compose -f /opt/jellyfin/compose.yaml pull
sudo docker compose -f /opt/jellyfin/compose.yaml up -d
sudo docker compose -f /opt/jellyfin/compose.yaml ps

The official Jellyfin container documentation uses the jellyfin/jellyfin image and persistent storage. A successful status resembles this:

NAME      SERVICE   STATUS    PORTS
jellyfin  jellyfin  Up        127.0.0.1:8096->8096/tcp

The loopback binding is intentional: only Nginx will be reachable from the public network. Do not add host networking unless you specifically need LAN discovery or DLNA.

Step 4: Configure Nginx and firewalld

Nginx will terminate the public web connection, pass WebSocket traffic to Jellyfin, and keep the backend on the host loopback address.

Install Nginx and Certbot from EPEL, then open only the web services in firewalld:

sudo dnf install -y epel-release
sudo dnf install -y nginx certbot python3-certbot-nginx
sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Create an HTTP server block. Replace YOUR_DOMAIN with the DNS name that points to this VPS:

sudo tee /etc/nginx/conf.d/jellyfin.conf >/dev/null <<'EOF'
server {
    listen 80;
    listen [::]:80;
    server_name YOUR_DOMAIN;

    client_max_body_size 20M;

    location / {
        proxy_pass http://127.0.0.1:8096;
        proxy_http_version 1.1;
        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_buffering off;
        proxy_read_timeout 3600s;
    }

    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";
        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;
    }
}
EOF
sudo setsebool -P httpd_can_network_connect 1
sudo nginx -t
sudo systemctl enable --now nginx

The SELinux boolean permits the Nginx process to connect to Jellyfin without disabling SELinux. nginx -t should print syntax is ok followed by test is successful.

Step 5: Add HTTPS with Certbot

Certbot can update the working Nginx block, request a Let’s Encrypt certificate, and redirect HTTP visitors to HTTPS.

Replace YOUR_EMAIL and YOUR_DOMAIN before running the command:

sudo certbot --nginx --non-interactive --agree-tos --no-eff-email --redirect --email YOUR_EMAIL --domain YOUR_DOMAIN
sudo certbot renew --dry-run

Certificate issuance requires public DNS to resolve YOUR_DOMAIN to this server and TCP 80 to be reachable through both the VPS provider firewall and firewalld. The dry run should finish with a successful simulated renewal.

Step 6: Finish the Jellyfin setup

The browser wizard creates the administrator account and maps your host media directory to Jellyfin’s /media path.

Open https://YOUR_DOMAIN, then complete the language and administrator screens. On the library screen, choose a content type and select /media as the folder; do not enter the host path /srv/jellyfin/media inside Jellyfin.

After signing in, open Dashboard → Networking → Known Proxies, add 127.0.0.1, and save. This tells Jellyfin to trust the forwarding headers from the local Nginx proxy so remote addresses and access rules work correctly.

Verify the Jellyfin installation

Run these checks from SSH to confirm the container, HTTPS response, and local firewall state:

sudo docker inspect --format '{{.State.Status}}' jellyfin
curl -fsS -o /dev/null -w 'HTTP %{http_code}\n' https://YOUR_DOMAIN/web/index.html
sudo firewall-cmd --list-services
sudo ss -ltnp | grep -E ':(80|443|8096)\b'
sudo docker compose -f /opt/jellyfin/compose.yaml logs --tail=25 jellyfin

Expected checks look similar to this:

running
HTTP 200
http https
LISTEN ... 127.0.0.1:8096 ...

The 8096 listener should show 127.0.0.1, while Nginx listens on the public web ports. In the browser, play a short file from the library to confirm that the scan and streaming path both work.

Troubleshooting

No match for argument: docker-ce

DNF has not loaded Docker’s RHEL repository, or its metadata is stale. Re-add the repository and rebuild the cache before checking which Enterprise Linux 8 packages are visible:

sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
sudo dnf clean all
sudo dnf makecache
sudo dnf list docker-ce --showduplicates

If no el8 package appears, check that /etc/os-release reports Rocky Linux 8 and that the server can reach download.docker.com.

Nginx shows 502 Bad Gateway

The proxy is running, but Jellyfin is stopped or Nginx cannot connect through SELinux. Check the container, backend, boolean, and recent log messages:

sudo docker compose -f /opt/jellyfin/compose.yaml ps
curl -I http://127.0.0.1:8096
sudo getsebool httpd_can_network_connect
sudo docker compose -f /opt/jellyfin/compose.yaml logs --tail=50 jellyfin

The boolean should say httpd_can_network_connect --> on. If the container is exited, read the first error in the log and start it again with sudo docker compose -f /opt/jellyfin/compose.yaml up -d.

The library is empty or Jellyfin reports permission denied

The host files may not be readable, a parent directory may lack execute permission, or a container was started without the SELinux mount suffix. Inspect the path and recreate the container using the Compose file above:

sudo namei -l /srv/jellyfin/media
sudo find /srv/jellyfin/media -maxdepth 1 -type f -printf '%M %u:%g %p\n' | head
sudo docker compose -f /opt/jellyfin/compose.yaml up -d --force-recreate

Use ownership and restrictive read permissions appropriate for your storage; do not solve this with chmod 777. Keep :Z on the bind mounts so Rocky Linux can apply the container label.

Certbot says unauthorized or times out

Let’s Encrypt could not reach the temporary HTTP endpoint. Confirm DNS, Nginx, and local firewall rules, then retry after the public record is correct:

getent hosts YOUR_DOMAIN
sudo systemctl is-active nginx
sudo firewall-cmd --list-services
sudo curl -I -H 'Host: YOUR_DOMAIN' http://127.0.0.1

The hostname must resolve to SERVER_IP, and any VPS provider firewall or cloud security group must permit TCP 80 and 443.

Hardening and maintenance

  • Keep 8096 bound to 127.0.0.1; the public service should be HTTPS through Nginx.
  • Back up /srv/jellyfin/config and the media disk. The config directory contains Jellyfin’s database, users, metadata, and settings.
  • Pull updates during a maintenance window with sudo docker compose -f /opt/jellyfin/compose.yaml pull and then sudo docker compose -f /opt/jellyfin/compose.yaml up -d.
  • Open UDP 7359 or use host networking only when you understand the LAN discovery or DLNA requirement; neither is needed for normal browser streaming.

FAQ

Can I use Jellyfin by IP address instead of a domain?

Yes, but a public IP does not qualify for a normal Let’s Encrypt certificate, so the HTTPS step needs a domain. For a private network you can use http://SERVER_IP:8096, but do not expose that unencrypted port to the internet.

Why is port 8096 missing from firewalld?

It is deliberately not opened. Docker publishes 8096 only on the host loopback interface, and Nginx receives external traffic on ports 80 and 443 before forwarding it locally.

Do I need host networking for remote streaming?

No. Bridge networking with a loopback port mapping is enough for web playback and remote access through Nginx. Host networking is mainly useful for discovery protocols such as DLNA and changes how the container reaches the host network.

How do I add another media library?

Create another host directory and add a second read-only bind mount, such as /srv/jellyfin/music:/music:ro,Z, to the Compose file. Recreate the container, then select /music in Jellyfin’s library wizard or library settings.

Samrat Ghosh
Written by

Samrat Ghosh

Founder & Infrastructure Engineer

Samrat Ghosh is the founder of VPSLake, where he builds and runs the remote desktop and VPS hosting infrastructure the company is built on. He writes hands-on guides about RDP, Windows Server, VPS management and secure remote access - the practical documentation he wishes had…

Previous Article

Marg ERP on Cloud: Run It on Your Own Windows RDP

Next Article

Best VPS for Coolify in 2026: Requirements and Costs

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *

Subscribe to our Newsletter

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨