Setting up a Jellyfin media server with Docker Compose
Stream your film, TV and music library on every device: install Jellyfin with Docker Compose, put it behind HTTPS and share it safely.
Tutorials · 2 min read
Jellyfin is a free, open-source media server you run on your own server. It lets you watch your own library (home videos, licensed content, your music collection) on phones, tablets, TVs and in the browser; no subscription and no tracking.
Note: host only content you legally own or have the right to share.
Requirements
- A server with Docker and Compose installed (see Installing Docker).
- Enough disk for your library: video grows fast; you can upgrade your plan or create a request for extra disk.
- Real-time transcoding is CPU-heavy: 4 vCPU or more is recommended; prefer direct play on clients where possible.
1. Prepare folders
mkdir -p ~/jellyfin/{config,cache} /srv/media/{movies,shows,music}
cd ~/jellyfin
2. The Compose file
Create compose.yaml:
services:
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
restart: unless-stopped
ports:
- "127.0.0.1:8096:8096"
volumes:
- ./config:/config
- ./cache:/cache
- /srv/media:/media:ro
environment:
- TZ=Europe/Istanbul
The port is bound to 127.0.0.1 only, so it isn’t exposed to the internet directly. The media folder is mounted :ro (read-only) so the application can’t change your library.
3. Start it and run the first-time setup
docker compose up -d
docker compose logs -f jellyfin
To try it locally at first, open an SSH tunnel: ssh -L 8096:127.0.0.1:8096 user@SERVER_IP, then browse to http://localhost:8096. In the wizard create the admin user, add libraries (such as /media/movies) and choose your language.
4. Publish it over HTTPS
For access from outside use a domain and a reverse proxy. With the steps in the Caddy guide you can point media.yourdomain.com at jellyfin:8096 and get a certificate automatically. First point the domain’s A record at the server IP (see DNS records).
5. Security and maintenance
- Use a strong admin password; delete accounts you don’t use.
- Keep sign-up and anonymous access off; create separate users for family and friends.
- To update:
docker compose pull && docker compose up -d - Back up the
configfolder (library and user settings) regularly; a backup of the media itself matters separately.
Performance tips
| Problem | Fix |
|---|---|
| Stuttering and high CPU | Choose a compatible format on the client; direct play needs no transcoding |
| Slow library scans | Name files in the standard way (Movie Name (2020)) |
| Disk filling up | Clear the cache and transcode folders, enlarge the disk |
Start with Melinhost
Pick a cloud server with enough disk and cores for a media server; upgrade the plan as your needs grow.