Running a Jellyfin media server on VPS puts your entire movie, show, and music collection on hardware you control, reachable from any device with an internet connection. Jellyfin is free and open source, and it ships an official Docker image, which makes installation on a virtual private server a short, repeatable process. This guide walks you through it end to end: picking the right VPS, writing a Docker Compose file, enabling hardware transcoding, locking it down behind HTTPS, organizing libraries, managing users, and keeping everything backed up.
VPS Requirements for a Self-Hosted Media Server
Before you start, make sure your server can actually do the job. Jellyfin itself is light, but video transcoding is CPU-hungry. Use this as a starting point:
- CPU: 2 vCPU is enough if most of your clients direct-play (no transcoding). If you plan to transcode 1080p streams, aim for 4 vCPU or a CPU with Quick Sync / VAAPI support.
- RAM: 4 GB is comfortable for a personal library; 2 GB works for a small one.
- Storage: Your media library decides this. A separate block volume for
/srv/mediakeeps the OS disk clean and lets you grow storage later without reinstalling. - Network: At least 100 Mbps outbound. One 1080p stream needs roughly 8–12 Mbps of sustained upload, so count your concurrent viewers and size accordingly.
- OS: Ubuntu 24.04 LTS works well and is used in the commands below.
Any entry-level VPS from a mainstream provider meets these numbers; prices change often, so check official pricing before you buy. Not sure a VPS is the right tier at all? Our shared hosting vs VPS vs dedicated comparison explains what you gain by moving up.
Step 1: Install Docker and Docker Compose
SSH into your VPS and install Docker using the official repository:
sudo apt update && sudo apt install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo $VERSION_CODENAME) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update && sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Confirm it works:
sudo docker run hello-world
docker compose version
Step 2: Write the Jellyfin Docker Compose File
Create a project folder and a compose.yaml for Jellyfin. This layout keeps config, cache, and media on three separate paths, which makes future moves and backups simple:
services:
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
user: 1000:1000
ports:
- "8096:8096"
volumes:
- /srv/jellyfin/config:/config
- /srv/jellyfin/cache:/cache
- /srv/media/movies:/media/movies:ro
- /srv/media/shows:/media/shows:ro
- /srv/media/music:/media/music:ro
devices:
- /dev/dri:/dev/dri
restart: unless-stopped
A few notes on the choices here:
- The
:roflag mounts media read-only, so a bug or a misconfigured plugin can never delete your files. /dev/dri:/dev/dripasses the GPU through for VAAPI hardware transcoding. If your VPS has no GPU (most cheap VPS plans do not), delete those two lines; Jellyfin still works with software transcoding.user: 1000:1000runs Jellyfin as your regular user instead of root. Make sure that user owns/srv/jellyfinand can read/srv/media.
Create the folders, then bring the stack up:
sudo mkdir -p /srv/jellyfin/config /srv/jellyfin/cache /srv/media/{movies,shows,music}
sudo chown -R 1000:1000 /srv/jellyfin
cd ~/jellyfin && docker compose up -d
docker compose logs -f jellyfin
Once the log shows the web server listening, open http://YOUR_SERVER_IP:8096 in a browser. The Jellyfin setup wizard greets you.
Step 3: Enable Jellyfin VAAPI Hardware Transcoding
If your VPS exposes /dev/dri (Intel iGPU, for example on some dedicated or high-end cloud instances), hardware transcoding cuts CPU load dramatically. Check first:
ls /dev/dri
If the folder exists, enable it in Jellyfin: go to Dashboard > Playback, set Hardware acceleration to Video Acceleration API (VAAPI), and tick the codecs your GPU supports (H.264, HEVC, and AV1 where available). Play a file and check Dashboard > Activity: it should show DirectStream or a transcode reason, and htop on the host should stay quiet.
No /dev/dri? Leave hardware acceleration off and rely on direct play. Most modern clients (Jellyfin Media Player, the Android and iOS apps, recent smart TVs) direct-play common formats, so transcoding is often unnecessary on a personal server. This is the single biggest factor in how much CPU your jellyfin docker compose setup actually needs.
Step 4: Secure Your Jellyfin Media Server on VPS with an Nginx Reverse Proxy
Exposing port 8096 directly to the internet means unencrypted HTTP traffic and password logins visible to anyone sniffing the path. Put Nginx in front and terminate HTTPS with a free Let’s Encrypt certificate.
Install Nginx and Certbot:
sudo apt install -y nginx certbot python3-certbot-nginx
Create /etc/nginx/sites-available/jellyfin:
server {
listen 80;
server_name media.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;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Enable it and get the 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.example.com
The websocket headers (Upgrade and Connection) matter: without them, the Jellyfin web client’s real-time updates break. With the certificate in place, this jellyfin nginx reverse proxy serves both the web UI and the API over HTTPS on the standard ports. After Certbot finishes, visit https://media.example.com and confirm the padlock. Then lock down the server firewall so only ports 22, 80, and 443 are open:
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
Step 5: Add Media Libraries
In the Jellyfin dashboard, go to Libraries > Add Media Library. Point each library at the folder you mounted in the compose file (/media/movies, /media/shows, /media/music) and pick the right content type so metadata scrapers fetch the correct posters and descriptions.
Name your files the way scrapers expect: Movie Title (2021)/Movie Title (2021).mkv for films and Show Name/Season 01/Show Name - S01E01.mkv for series. Clean naming is the difference between a library that fills itself in and one you fix by hand. After adding a library, trigger Scan All Libraries and wait; the first scan of a big collection can take a while.
Step 6: Create User Accounts
Do not share your admin account. Under Dashboard > Users, create one account per person, give each only the libraries they should see, and set parental ratings where needed. Each user gets their own watch history, favorites, and resume points. Turn on Require authentication for remote connections and consider disabling the admin account’s remote login once everything works.
Step 7: Update Jellyfin Without Breaking Anything
Updates are a pull and a recreate. Run them from the project folder:
cd ~/jellyfin
docker compose pull
docker compose up -d
docker image prune -f
Your config, cache, and media live in mounted volumes, so the new container picks up exactly where the old one left off. Check the Jellyfin release notes first when jumping major versions; database migrations occasionally need an extra step.
Step 8: Back Up the Data That Matters
You do not need to back up the media files themselves if you have the originals elsewhere, but the Jellyfin database, user accounts, and watch history live in /srv/jellyfin/config and are worth protecting. A nightly rsync to another server or an object-storage bucket is enough for a personal setup:
rsync -a --delete /srv/jellyfin/config/ user@backup-server:/backups/jellyfin-config/
Test restores occasionally. A backup you have never restored is a hope, not a plan. For watching the server itself, our guide to installing Uptime Kuma with Docker adds monitoring in a few minutes.
FAQ
Can I run Jellyfin on a cheap VPS without a GPU?
Yes. Jellyfin runs fine on a 2 vCPU / 4 GB VPS for direct play. The GPU only matters for transcoding, and you avoid transcoding entirely when your clients support the file formats.
Wrapping Up
You now have a jellyfin media server on VPS running in Docker: compose-managed, optionally GPU-accelerated, served over HTTPS, with organized libraries and per-user accounts. The whole stack is defined in one compose file, so moving it to a bigger server later is a copy-and-paste job. Add new media to /srv/media, let the scheduled scans pick it up, and enjoy a streaming service that answers to nobody but you.