Jellyfin is the leading open-source media server — a self-hosted alternative to Plex and Emby that streams your personal video, music, and photo library to any device with no licensing fees, no subscription, and no data sent to third-party servers. Running Jellyfin on a Hong Kong VPS makes your personal media library accessible across Asia with CN2 GIA routing providing stable streaming from mainland China, Taiwan, and Southeast Asia.
Use Cases for Jellyfin on Hong Kong VPS
- Personal media library (ripped Blu-rays, home videos, downloaded content you own) accessible from any device across Asia
- Family media sharing — one server, multiple user accounts with personalised libraries and parental controls
- Corporate media library — internal training videos, company presentations, and event recordings accessible to distributed Asia-Pacific teams
- Photography and music archive — centralised storage with web and mobile access
VPS Requirements
| Use Case | RAM | vCPU | Storage | Notes |
|---|---|---|---|---|
| Direct play only (no transcoding) | 2 GB | 2 | Media volume | Most efficient setup |
| Software transcoding (1–2 streams) | 4 GB | 4 | Media volume | High CPU during transcode |
| Software transcoding (3–5 streams) | 8 GB | 8 | Media volume | Consider dedicated server |
Storage note: Media libraries require large volumes. Most VPS plans include 40–200 GB NVMe. For large libraries, attach an additional block storage volume or use an S3-compatible object store (Cloudflare R2, MinIO) for media files.
Step 1: Install Jellyfin via Docker
apt update && apt upgrade -y
apt install -y docker.io docker-compose-plugin ufw
# Create media directories
mkdir -p /opt/jellyfin/{config,cache}
mkdir -p /mnt/media/{movies,tvshows,music,photos}
# Set permissions
chown -R 1000:1000 /opt/jellyfin /mnt/media
Create /opt/jellyfin/docker-compose.yml:
version: '3.8'
services:
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
restart: unless-stopped
ports:
- "127.0.0.1:8096:8096" # HTTP (proxied via Nginx)
- "7359:7359/udp" # Local network discovery (optional)
environment:
- JELLYFIN_PublishedServerUrl=https://media.yourdomain.com
volumes:
- /opt/jellyfin/config:/config
- /opt/jellyfin/cache:/cache
- /mnt/media:/media:ro # Read-only mount for safety
devices:
# Uncomment if your VPS has hardware transcoding capability
# - /dev/dri:/dev/dri
cd /opt/jellyfin && docker compose up -d
docker compose logs -f # Watch startup logs
Step 2: Configure Nginx with SSL
apt install -y nginx certbot python3-certbot-nginx
cat > /etc/nginx/sites-available/jellyfin << 'EOF'
server {
listen 80;
server_name media.yourdomain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name media.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/media.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/media.yourdomain.com/privkey.pem;
# Jellyfin requires large body size for media uploads
client_max_body_size 20G;
client_body_timeout 300s;
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";
# Disable buffering for streaming
proxy_buffering off;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
}
}
EOF
ln -s /etc/nginx/sites-available/jellyfin /etc/nginx/sites-enabled/
certbot --nginx -d media.yourdomain.com
nginx -t && systemctl reload nginx
ufw allow 80/tcp && ufw allow 443/tcp
ufw enable
Step 3: Initial Setup
Visit https://media.yourdomain.com and complete the setup wizard:
- Create admin account
- Add media libraries — point each library type to the corresponding folder:
- Movies:
/media/movies - TV Shows:
/media/tvshows - Music:
/media/music - Photos:
/media/photos
- Movies:
- Select metadata providers (TheMovieDB for movies, TheTVDB for TV)
- Allow the initial library scan to complete (time depends on library size)
Step 4: Upload Media to Your VPS
From Local Machine via rsync
# Sync a local movie directory to your VPS
rsync -avz --progress ~/Movies/ root@YOUR_VPS_IP:/mnt/media/movies/
# Sync TV shows
rsync -avz --progress ~/TVShows/ root@YOUR_VPS_IP:/mnt/media/tvshows/
File Naming Convention (Important for Metadata)
Jellyfin’s metadata scrapers require specific naming patterns:
# Movies: MovieName (Year).extension
/media/movies/Inception (2010)/Inception (2010).mkv
/media/movies/The Dark Knight (2008)/The Dark Knight (2008).mp4
# TV Shows: SeriesName/Season XX/SeriesName S01E01.extension
/media/tvshows/Breaking Bad/Season 01/Breaking Bad S01E01.mkv
/media/tvshows/Breaking Bad/Season 01/Breaking Bad S01E02.mkv
Correct naming ensures Jellyfin automatically fetches posters, descriptions, ratings, and subtitle options for your media.
Step 5: Configure Transcoding
In Jellyfin admin panel: Dashboard → Playback → Transcoding
Direct Play (Recommended for VPS)
Configure your Jellyfin clients to prefer direct play — streams the original file without transcoding. This uses minimal server CPU and provides the best quality. Works when your client device supports the codec (H.264, H.265/HEVC, VP9).
- Modern smart TVs, Apple TV 4K, Roku, and Shield TV support H.264 and H.265 direct play
- Desktop browsers support H.264 natively; H.265 requires the Jellyfin desktop app
- Mobile devices with Jellyfin app support most common codecs for direct play
Software Transcoding
When a client cannot direct play (older device, unsupported codec, or bandwidth limitation), Jellyfin transcodes on the server. Software transcoding on a 4-vCPU VPS handles 1–2 simultaneous 1080p streams; beyond that, you need more vCPUs or a dedicated server with hardware encoding.
# In Jellyfin Dashboard → Playback → Transcoding:
# Transcoding thread count: set to your vCPU count - 1
# (Leave 1 core for the OS and other processes)
Step 6: Add External Storage for Large Libraries
For media libraries over 200 GB, mount additional block storage rather than expanding your VPS root disk:
# After attaching additional block storage through your VPS control panel:
# Identify the new disk
lsblk
# Format (only on first use — this destroys existing data)
mkfs.ext4 /dev/sdb
# Mount
mkdir -p /mnt/mediavol
echo "/dev/sdb /mnt/mediavol ext4 defaults 0 0" >> /etc/fstab
mount -a
# Update Docker volume paths in docker-compose.yml
# Change /mnt/media to /mnt/mediavol in the volumes section
# Then: docker compose down && docker compose up -d
Step 7: Jellyfin Mobile and Desktop Clients
- iOS / Android: Official Jellyfin app — free, no subscription
- Android TV / Fire TV: Jellyfin for Android TV
- Apple TV: Jellyfin for tvOS (via TestFlight or AltStore)
- Roku: Jellyfin channel available in Roku Channel Store
- Desktop (Windows/macOS/Linux): Jellyfin Media Player (Electron-based)
- Browser: Any modern browser via
https://media.yourdomain.com
Configure each client with server URL: https://media.yourdomain.com
Streaming Performance from Asia
With CN2 GIA routing from your Hong Kong VPS, streaming performance to mainland Chinese and other Asian devices:
- 1080p direct play: requires ~8–25 Mbps depending on bitrate; CN2 GIA provides consistent throughput with <0.1% packet loss, eliminating the buffering that standard routing causes
- 4K direct play: requires 25–80 Mbps; achievable for users with good broadband but requires your VPS plan to have adequate outbound bandwidth
- 1080p transcode: bitrate-limited by your quality setting; CN2 GIA makes the stream stable regardless of time of day
Automated Backups for Jellyfin Config
cat > /opt/jellyfin-config-backup.sh << 'EOF'
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
# Backup config only (not media — media is your source of truth)
tar czf /opt/backups/jellyfin_config_$DATE.tar.gz /opt/jellyfin/config/
find /opt/backups/ -name "jellyfin_config_*" -mtime +14 -delete
echo "Jellyfin config backup: $DATE"
EOF
chmod +x /opt/jellyfin-config-backup.sh
crontab -l | { cat; echo "0 4 * * * /opt/jellyfin-config-backup.sh"; } | crontab -
Conclusion
Jellyfin on a Hong Kong VPS provides a fully self-hosted, subscription-free media server accessible to all your devices across Asia. CN2 GIA routing ensures stable streaming to mainland China without the buffering that plagues media access over standard internet routing, and the Hong Kong location keeps all your personal media on infrastructure you control rather than on third-party cloud servers.
Launch your media server: Browse Server.HK Hong Kong VPS plans — a 4 GB VPS handles Jellyfin with software transcoding for 1–2 simultaneous streams; upgrade to 8 GB for larger families or teams.