Deploying a Jellyfin App
Introduction
Jellyfin is an open-source media server for streaming music and video. Deploying Jellyfin with a Dockerfile on Klutch.sh gives you reproducible builds, managed secrets, and persistent storage for libraries and metadata—all orchestrated from klutch.sh/app. This guide covers installation, repository prep, a production-ready Dockerfile, deployment steps, Nixpacks overrides, and best practices for reliable media streaming.
Prerequisites
- A Klutch.sh account (create one)
- A GitHub repository containing your Jellyfin config or customizations (GitHub is the only supported git source)
- Docker familiarity and basic media server operations
- Storage for media libraries and metadata backups
For platform onboarding, see the Quick Start.
Architecture and ports
- Jellyfin serves HTTP on port
8096(and HTTPS on8920if enabled). Set the internal container port to8096for HTTP traffic on Klutch.sh. - If you run auxiliary TCP services (e.g., a database or cache), deploy them as separate Klutch.sh TCP apps exposed on port
8000and connect on their native ports. - Persistent storage is required for configuration, cache, and media libraries.
Repository layout
jellyfin/├── config/ # Jellyfin configs (mount as volume)├── cache/ # Transcoding/cache data (mount as volume)├── media/ # Your media library (mount as volume)├── Dockerfile # Must be at repo root for auto-detection└── README.mdKeep secrets (if any) out of Git; store them in Klutch.sh environment variables.
Installation (local) and starter commands
Quick local run for validation:
docker run --rm -p 8096:8096 \ -v $(pwd)/config:/config \ -v $(pwd)/cache:/cache \ -v /path/to/media:/media \ jellyfin/jellyfin:latestOptional helper start.sh for portability and Nixpacks fallback:
#!/usr/bin/env bashset -euo pipefailexec jellyfin --datadir /config --cachedir /cache --ffmpeg /usr/lib/jellyfin-ffmpeg/ffmpegMake it executable with chmod +x start.sh.
Dockerfile for Jellyfin (production-ready)
Place this Dockerfile at the repo root; Klutch.sh auto-detects it (no Docker selection in the UI):
FROM jellyfin/jellyfin:10.8.13
WORKDIR /app
# Optionally copy custom config defaultsCOPY config /config
EXPOSE 8096CMD ["jellyfin", "--datadir", "/config", "--cachedir", "/cache"]Notes:
- Pin the Jellyfin image tag for reproducible builds.
- If you need hardware acceleration (VAAPI/NVENC), ensure your base image and runtime support the required drivers and devices.
Environment variables (Klutch.sh)
Set these in the Klutch.sh app settings (Secrets tab) before deploying:
JELLYFIN_PublishedServerUrl=https://example-app.klutch.shJELLYFIN_CACHE_DIR=/cacheJELLYFIN_DATA_DIR=/configJELLYFIN_FFmpegPath=/usr/lib/jellyfin-ffmpeg/ffmpeg(if overriding)PORT=8096
If you deploy without the Dockerfile and want Nixpacks overrides:
NIXPACKS_BUILD_CMD="dotnet publish --configuration Release"NIXPACKS_START_CMD="jellyfin --datadir /config --cachedir /cache"NIXPACKS_DOTNET_VERSION=6.0
These keep Jellyfin compatible with Nixpacks defaults when a Dockerfile is absent.
Attach persistent volumes
In Klutch.sh storage settings, add mount paths and sizes (no names required):
/config— required for Jellyfin configuration and metadata./cache— recommended for transcodes and cache./media— your media library mount.
Ensure these paths are writable inside the container.
Deploy Jellyfin on Klutch.sh (Dockerfile workflow)
- Push your repository (with the Dockerfile at the root) to GitHub.
- Open klutch.sh/app, create a project, and add an app.
- Connect the GitHub repository; Klutch.sh automatically detects the Dockerfile.
- Choose HTTP traffic for Jellyfin.
- Set the internal port to
8096. - Add the environment variables above (server URL, cache/data dirs, FFmpeg path, and any
NIXPACKS_*overrides if you temporarily deploy without the Dockerfile). - Attach persistent volumes for
/config,/cache, and/media, selecting sizes that match your library and transcode needs. - Deploy. Your media server will be reachable at
https://example-app.klutch.sh; attach a custom domain if desired.
Health checks and production tips
- Add a lightweight reverse proxy health endpoint (e.g.,
/health) that checks the Jellyfin UI availability. - Enforce HTTPS at the edge; forward HTTP to port 8096 internally.
- Monitor disk usage for
/media,/config, and/cache; resize volumes before they fill. - Keep the image tag pinned and update deliberately to track upstream changes.
- If using hardware acceleration, validate driver/device availability in your deployment environment.
Jellyfin on Klutch.sh combines reproducible Docker builds with managed secrets, persistent volumes for media and metadata, and flexible HTTP/TCP routing. With the Dockerfile at the repo root and ports set to 8096 for the app (8000 externally for any TCP companions), you can stream your library reliably without extra YAML or workflow overhead.