Jellyfin
Install Jellyfin media server on VPS with Docker or native installation, stream your media from anywhere
Jellyfin is a free, open-source media server that lets you stream movies, TV shows, music, and photos from anywhere. It's a fully self-hosted alternative to Plex with no proprietary restrictions.
What is Jellyfin?
Jellyfin is a complete media management and streaming solution. Unlike Plex, there's no account requirement, no limits on users or devices, and complete control over your data. You own everything.
Docker Installation
Docker Compose Setup
Create /etc/docker/compose/jellyfin/docker-compose.yml:
version: '3.8'
services:
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
restart: always
ports:
- "8096:8096"
- "8920:8920"
environment:
- JELLYFIN_CACHE_DIR=/cache
- JELLYFIN_CONFIG_DIR=/config
- JELLYFIN_DATA_DIR=/config
- JELLYFIN_LOG_DIR=/config/logs
volumes:
- jellyfin_config:/config
- jellyfin_cache:/cache
- /media/movies:/media/movies:ro
- /media/tvshows:/media/tvshows:ro
- /media/music:/media/music:ro
devices:
- /dev/dri:/dev/driDeploy:
cd /etc/docker/compose/jellyfin
docker compose up -dCheck status:
docker compose logs -f jellyfinNative Installation (Ubuntu/Debian)
Add the Jellyfin repository:
apt install -y software-properties-common
add-apt-repository ppa:jellyfin/jellyfin
apt update
apt install -y jellyfinStart the service:
systemctl start jellyfin
systemctl enable jellyfinVerify it's running:
systemctl status jellyfin
ss -tlnp | grep 8096Media Structure
Organize your media in a standard format:
/media/
├── movies/
│ ├── Movie Title (2023)/
│ │ └── Movie.Title.2023.mkv
│ └── Another Film/
│ └── Another.Film.mkv
├── tvshows/
│ ├── Show Name/
│ │ ├── Season 01/
│ │ │ ├── Show.Name.S01E01.mkv
│ │ │ └── Show.Name.S01E02.mkv
│ │ └── Season 02/
│ │ └── Show.Name.S02E01.mkv
└── music/
├── Artist Name/
└── Album Name/
├── 01 - Song.mp3
└── 02 - Another.mp3Set proper permissions:
chown -R jellyfin:jellyfin /media
chmod -R 755 /mediaInitial Configuration
Access Jellyfin at http://your-ip:8096 and complete the setup wizard:
-
Language selection
-
Create admin user (username and password)
-
Configure media library
- Click "Add Library"
- Select type (Movies, TV Shows, Music, etc.)
- Add folders matching your
/mediastructure - Name the library
-
Remote access setup (optional, covered below)
-
Metadata configuration
After setup, restart scanning:
curl -X POST http://localhost:8096/Library/RefreshNginx Reverse Proxy
Configure Nginx to proxy Jellyfin:
server {
listen 80;
server_name jellyfin.example.com;
client_max_body_size 20M;
location / {
proxy_pass http://localhost: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-Host $server_name;
proxy_set_header X-Forwarded-Port 443;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Timeouts
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
}
}Test and reload:
nginx -t
systemctl reload nginxIn Jellyfin settings under Dashboard → General → Networking, set:
- External domain:
jellyfin.example.com - HTTPS: enabled
Hardware Acceleration
Intel Quick Sync (VAAPI)
In Docker, add device mapping to docker-compose.yml:
devices:
- /dev/dri:/dev/driVerify Intel GPU is available:
docker exec jellyfin ls -la /dev/driIn Jellyfin Dashboard → Playback → Transcoding, select:
- Preferred hardware acceleration: VA-API
NVIDIA GPU
Install NVIDIA runtime:
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | tee /etc/apt/sources.list.d/nvidia-docker.list
apt update
apt install -y nvidia-docker2
systemctl restart dockerUpdate docker-compose.yml:
services:
jellyfin:
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=allVerify GPU is accessible:
docker exec jellyfin nvidia-smiIn Jellyfin Dashboard → Playback → Transcoding, select:
- Preferred hardware acceleration: NVENC
Docker Updates
Update to the latest version:
cd /etc/docker/compose/jellyfin
docker compose pull
docker compose up -d
docker image prune -fUseful Commands
Check Jellyfin logs:
docker compose logs -f jellyfinForce library scan:
curl -X POST http://localhost:8096/Library/RefreshView active users and sessions:
curl -s http://localhost:8096/Sessions | jqBackup
Backup Jellyfin configuration:
docker compose exec jellyfin tar czf /config/backup.tar.gz /config
docker compose cp jellyfin:/config/backup.tar.gz ./jellyfin-backup-$(date +%Y%m%d).tar.gzJellyfin is completely free and open-source. No subscriptions, no limits on users or devices, no cloud requirement. You have full control over your media library and streaming experience.
Common Issues
If transcoding fails, check that codec support is available:
docker exec jellyfin ffmpeg -codecs | grep -i h264For "Cannot connect" errors, verify the reverse proxy headers are correct and Jellyfin's domain settings match your external URL.
If playback is slow, enable hardware acceleration. Without GPU support, CPU transcoding will be inefficient.