Install Jellyfin with Docker on AlmaLinux 8 and serve your media library through an HTTPS address. This setup takes about 15 minutes on a fresh VPS and keeps Jellyfin’s web port private behind Nginx.
Prerequisites
- A 64-bit AlmaLinux 8 VPS with at least 2 GB of RAM and 20 GB of free disk space, plus enough extra storage for your media.
- SSH access as
root, or a regular account with workingsudoprivileges. - A domain such as
YOUR_DOMAINwith an A record pointing toSERVER_IP. - Inbound TCP ports 80 and 443 allowed by both your VPS provider and firewalld. Port 8096 stays bound to localhost.
- A VPSLake Linux VPS if you need an AlmaLinux server with root access.
These instructions install Docker Engine and Compose as part of the process. If you are already root, remove sudo from the commands.
Step 1: Update AlmaLinux and install Docker
Updating the host first gives Docker a current Enterprise Linux package environment and reduces dependency conflicts.
grep -E '^(PRETTY_NAME|VERSION_ID|ID_LIKE)=' /etc/os-release
uname -m
sudo dnf upgrade -y
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 makecache
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
The removal command is intended for a new VPS. Do not remove Podman or runc from a host that already runs production containers until you have checked those workloads. Docker’s RHEL installation guide documents the compatible RPM repository method.
Confirm that both Docker and the Compose plugin work:
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 includes an active service, version strings, and the Docker smoke-test message:
active
Client X.Y.Z / Server X.Y.Z
Docker Compose version v2.X.Y
Hello from Docker!
The exact versions vary as Docker publishes updates.
Step 2: Prepare Jellyfin’s persistent directories
Bind mounts keep your configuration, cache, and media outside the disposable container layer, while :Z lets SELinux label the directories for private container use.
sudo install -d -m 0750 /srv/jellyfin/config /srv/jellyfin/cache /srv/jellyfin/media
sudo install -d -m 0750 /opt/jellyfin
Place the video, music, or photo files you want Jellyfin to index under /srv/jellyfin/media. The container will see that directory as /media; the media mount is read-only so the server cannot alter the originals.
Step 3: Create and start the Jellyfin container
Compose makes the restart policy and storage mappings repeatable, and binding port 8096 to 127.0.0.1 prevents direct public access to the unencrypted backend.
Create 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 YAML, download the official image, and start the service:
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 container should show Up and a loopback-only port mapping:
NAME SERVICE STATUS PORTS
jellyfin jellyfin Up 127.0.0.1:8096->8096/tcp
Jellyfin’s official container guide uses the same image and persistent config/cache pattern. This guide omits UDP 7359 because a public VPS normally does not need LAN client discovery; add it later only if your network requires it.
Step 4: Install Nginx and open HTTPS in firewalld
Nginx will be the only internet-facing service, forwarding browser requests to Jellyfin and giving Certbot a web server to configure.
Install Nginx and Certbot from AlmaLinux 8’s EPEL repository, then enable the firewall and web services:
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 initial HTTP reverse-proxy server block. Replace YOUR_DOMAIN with the hostname whose DNS record points to this VPS:
sudo tee /etc/nginx/conf.d/jellyfin.conf >/dev/null <<'EOF'
server {
listen 80;
listen [::]:80;
server_name YOUR_DOMAIN;
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_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_buffering off;
proxy_read_timeout 3600s;
}
}
EOF
sudo setsebool -P httpd_can_network_connect 1
sudo nginx -t
sudo systemctl enable --now nginx
The SELinux boolean permits Nginx to connect to the local Docker-published port without disabling SELinux. nginx -t should report that the syntax is okay and the test is successful.
Step 5: Issue a Let’s Encrypt certificate
Certbot can edit the working Nginx server block and add the HTTPS listener, redirect, and certificate renewal timer after it confirms your domain.
Replace both placeholders before running this command:
sudo certbot --nginx --non-interactive --agree-tos --no-eff-email --redirect --email YOUR_EMAIL --domain YOUR_DOMAIN
The command succeeds only when YOUR_DOMAIN resolves to this VPS and port 80 is reachable from the internet. Certbot installs automatic renewal; test the renewal path without requesting a real certificate:
sudo certbot renew --dry-run
You should see a successful simulated renewal. If you use a DNS proxy, make sure it forwards HTTP and HTTPS to this server during issuance.
Verify the Jellyfin installation
Check the container, HTTPS endpoint, firewall services, and recent application logs:
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 docker compose -f /opt/jellyfin/compose.yaml logs --tail=30 jellyfin
Expected checks look like this:
running
HTTP 200
http https
Open https://YOUR_DOMAIN in a browser and complete Jellyfin’s first-run wizard. Create the administrator account, choose the display language, then add a media library using /media as the container path. The files in /srv/jellyfin/media should appear after the scan starts.
Troubleshooting
No match for argument: docker-ce
DNF did not load Docker’s RHEL repository, or its metadata is stale. Re-add the repository and rebuild the cache before retrying the package install:
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
sudo dnf clean all
sudo dnf makecache
dnf list --showduplicates docker-ce
The list should include an el8 Docker package from the stable repository.
Nginx returns 502 Bad Gateway
The proxy can answer, but Jellyfin is not listening on localhost or SELinux is blocking Nginx’s connection. Check both services and the container log:
sudo docker ps --filter name=jellyfin
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 SELinux check should say httpd_can_network_connect --> on. If the container is stopped, inspect its first error and restart it with sudo docker compose -f /opt/jellyfin/compose.yaml up -d.
Jellyfin cannot read the media directory
The :ro,Z mount handles container labeling, but the host files still need directory execute permission and file read permission. Check the path and recreate the container so Docker reapplies the SELinux label:
sudo namei -l /srv/jellyfin/media
sudo chmod 0750 /srv/jellyfin/media
sudo docker compose -f /opt/jellyfin/compose.yaml up -d --force-recreate
Do not use chmod 777; correct the owner and group on the media files if the existing permissions are too restrictive.
Certbot reports a failed domain validation
The DNS record may point elsewhere, or a provider firewall may still block TCP 80. Confirm the public DNS result and the local web service, then retry after the record has propagated:
getent hosts YOUR_DOMAIN
sudo firewall-cmd --list-services
sudo systemctl is-active nginx
The hostname must resolve to SERVER_IP, and the provider-level firewall must allow HTTP and HTTPS in addition to firewalld.
Hardening and maintenance
- Keep port 8096 bound to
127.0.0.1; do not publish it publicly after Nginx is working. - Back up
/srv/jellyfin/configand your media storage. The config directory contains the database, users, metadata, and server settings. - Update during a maintenance window with
sudo docker compose -f /opt/jellyfin/compose.yaml pullfollowed bysudo docker compose -f /opt/jellyfin/compose.yaml up -d. - If you need DLNA or LAN discovery, review Jellyfin’s networking requirements before opening additional UDP ports.
FAQ
Can I install Jellyfin without a domain?
Yes, but this HTTPS reverse-proxy setup expects a domain for a trusted Let’s Encrypt certificate. For a private LAN, you can access a separately configured Jellyfin HTTP port by IP, but do not expose that unencrypted interface to the public internet.
Why is port 8096 not open in firewalld?
The Compose file maps Jellyfin to localhost, so outside clients cannot reach it directly. Nginx handles public traffic on ports 80 and 443 and forwards it internally over the host loopback interface.
Where should I put movies and music?
Copy them into /srv/jellyfin/media on the host. In the Jellyfin setup wizard, choose the matching container path /media; the read-only mount protects the source files from changes by the container.
Does Jellyfin need host networking for Docker?
No. Bridge networking plus a published HTTP port is enough for web playback and remote streaming through Nginx. Host networking is useful for features such as DLNA, but it exposes more host network behavior and is not necessary for this web-focused deployment.