Kyoo
A portable and vast media library solution
Alternative to: plex, netflix, emby
Kyoo is a self-hosted media server focused on video content: movies, series and anime. It needs no folder structure or manual metadata edits, and offers dynamic transcoding with adaptive bitrate, video preview thumbnails, intro/credit detection, subtitle support and OIDC sign-in. Clients are available for web, Android, Android TV and Chromecast.
Kyoo Docker Compose example
Self-host Kyoo on your own server, homelab, or VPS starting from this Docker Compose example.
It runs Kyoo in Docker containers using the official traefik:latest, ghcr.io/zoriya/kyoo_front:latest, ghcr.io/zoriya/kyoo_auth:latest, ghcr.io/zoriya/kyoo_api:latest, ghcr.io/zoriya/kyoo_scanner:latest, ghcr.io/zoriya/kyoo_transcoder:latest, postgres:18 images, with persistent volumes and automatic restarts preconfigured.
Review the environment variables and adjust them to your setup, save the file as compose.yml (or docker-compose.yml), and start the stack with docker compose up -d.
x-postgres-env: &postgres-env
# PostgreSQL user Kyoo connects with
PGUSER: "kyoo"
# PostgreSQL password (internal to this compose network; change it before first start)
PGPASSWORD: "changeme"
# PostgreSQL database name
PGDATABASE: "kyoo"
# PostgreSQL host (the postgres service below)
PGHOST: "postgres"
# PostgreSQL port
PGPORT: "5432"
services:
# Single entrypoint: routes /, /api, /auth, /video and /scanner to the services below
traefik:
image: traefik:latest
restart: unless-stopped
command:
- "--providers.file.filename=/etc/traefik/dynamic.yml"
- "--entryPoints.web.address=:8901"
- "--accesslog=true"
- "--accesslog.fields.queryparameters.defaultmode=drop"
volumes:
- ./traefik.yml:/etc/traefik/dynamic.yml:ro
depends_on:
- front
- auth
- api
- scanner
- transcoder
# Web client (static files served by nginx)
front:
image: ghcr.io/zoriya/kyoo_front:latest
restart: unless-stopped
# Keibi: users, sessions, API keys and OIDC; signs the JWTs the other services verify
auth:
image: ghcr.io/zoriya/kyoo_auth:latest
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
<<: *postgres-env
# The URL you use to reach your Kyoo instance (used as JWT issuer and for OIDC redirects)
PUBLIC_URL: "http://localhost:8901"
# Extra post-login OIDC redirect targets, comma separated (the kyoo app scheme is always allowed)
EXTRA_OIDC_REDIRECT_URLS: "kyoo"
# Set to true to disable creating new accounts
DISABLE_REGISTRATION: "false"
# Default claims of new users (set verified to true to skip manual verification)
EXTRA_CLAIMS: '{"permissions": ["core.read", "core.play"], "verified": false}'
# Claims of the first user (the first user is admin)
FIRST_USER_CLAIMS: '{"permissions": ["users.read", "users.write", "users.delete", "apikeys.read", "apikeys.write", "core.read", "core.write", "core.play", "scanner.trigger", "scanner.guess", "scanner.search", "scanner.add"], "verified": true}'
# Claims of guests (not logged in); empty means guests must log in first
GUEST_CLAIMS: '{"permissions": ["core.read"], "verified": true}'
# Claims users cannot change themselves (do not change)
PROTECTED_CLAIMS: "permissions,verified"
# Lazily-created API key used by the scanner (do not change)
KEIBI_APIKEY_SCANNER: "lazy"
# Claims of the scanner API key (do not change)
KEIBI_APIKEY_SCANNER_CLAIMS: '{"permissions": ["core.read", "core.write"]}'
# Where uploaded profile pictures are stored
PROFILE_PICTURE_PATH: "/profile_pictures"
volumes:
- profile_pictures:/profile_pictures
# Main API (library, metadata, watch status)
api:
image: ghcr.io/zoriya/kyoo_api:latest
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
<<: *postgres-env
# Expected issuer of the JWTs (must equal PUBLIC_URL)
JWT_ISSUER: "http://localhost:8901"
# Internal URL of the auth service
AUTH_SERVER: "http://auth:4568"
# Internal URL of the transcoder
TRANSCODER_SERVER: "http://transcoder:7666"
# Where downloaded show images are stored
IMAGES_PATH: "/images"
volumes:
- images:/images
# Watches the library, identifies media and fetches metadata
scanner:
image: ghcr.io/zoriya/kyoo_scanner:latest
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
auth:
condition: service_started
environment:
<<: *postgres-env
# Path of the media library inside the container
SCANNER_LIBRARY_ROOT: "/video"
# Regex of files to ignore
LIBRARY_IGNORE_PATTERN: ".*/[dD]ownloads?/.*"
# TheMovieDB read access token; leave empty to use Kyoo's default key
THEMOVIEDB_API_ACCESS_TOKEN: ""
# TheTVDB API key; leave empty to use Kyoo's default key
TVDB_APIKEY: ""
# TheTVDB subscriber PIN (optional)
TVDB_PIN: ""
# Kyoo API URL, reached through traefik so the API key is exchanged for a JWT
KYOO_URL: "http://traefik:8901/api"
# Internal URL of the auth service
AUTH_SERVER: "http://auth:4568"
# Where to fetch the keys used to verify JWTs
JWKS_URL: "http://auth:4568/.well-known/jwks.json"
# Expected issuer of the JWTs (must equal PUBLIC_URL)
JWT_ISSUER: "http://localhost:8901"
volumes:
- library:/video:ro
# On-the-fly transcoding with adaptive bitrate (CPU, no hardware acceleration)
transcoder:
image: ghcr.io/zoriya/kyoo_transcoder:latest
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
auth:
condition: service_started
environment:
<<: *postgres-env
# Where to fetch the keys used to verify JWTs
JWKS_URL: "http://auth:4568/.well-known/jwks.json"
# Path of the media library inside the container
GOCODER_SAFE_PATH: "/video"
# Scratch directory for transcoded segments (cleaned up automatically)
GOCODER_CACHE_ROOT: "/cache"
# Persistent metadata (thumbnails, extracted subtitles, keyframes)
GOCODER_METADATA_ROOT: "/metadata"
# Hardware acceleration: disabled (CPU)
GOCODER_HWACCEL: "disabled"
# ffmpeg preset; faster means worse quality
GOCODER_PRESET: "fast"
# PostgreSQL TLS mode
PGSSLMODE: "disable"
volumes:
- library:/video:ro
- cache:/cache
- transcoder_metadata:/metadata
postgres:
image: postgres:18
restart: unless-stopped
environment:
# PostgreSQL superuser created on first start (must match PGUSER)
POSTGRES_USER: "kyoo"
# PostgreSQL superuser password (must match PGPASSWORD)
POSTGRES_PASSWORD: "changeme"
# Database created on first start (must match PGDATABASE)
POSTGRES_DB: "kyoo"
volumes:
- db:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U kyoo -d kyoo"]
interval: 5s
timeout: 5s
retries: 5
volumes:
# Your media library (movies, series, anime); mounted read-only by scanner and transcoder
library:
cache:
transcoder_metadata:
images:
profile_pictures:
db:
Values set to changeme are required — replace them with your own
values before starting Kyoo.
Extra files
The Docker Compose configuration above bind-mounts the following file. Save it next to your compose.yml,
keeping the same relative path.
traefik.yml
# Traefik dynamic configuration for Kyoo: path-based routing in front of the
# Kyoo services, with the "phantom token" forward-auth through keibi (auth).
# Mirrors the traefik labels of the upstream docker-compose.yml.
http:
routers:
front:
rule: "PathPrefix(`/`)"
service: front
auth:
rule: "PathPrefix(`/auth/`) || PathPrefix(`/.well-known/`)"
service: auth
# presigns are checked against those, only traefik's forwardauth may set them
middlewares: [strip-forwarded]
swagger:
rule: "PathPrefix(`/swagger`)"
service: api
api:
rule: "PathPrefix(`/api/`)"
service: api
middlewares: [cors, phantom-token]
scanner:
rule: "PathPrefix(`/scanner/`)"
service: scanner
middlewares: [phantom-token]
transcoder:
rule: "PathPrefix(`/video`)"
service: transcoder
middlewares: [cors, phantom-token]
middlewares:
phantom-token:
forwardAuth:
address: "http://auth:4568/auth/jwt"
authRequestHeaders: [Authorization, Cookie, X-Api-Key, Sec-WebSocket-Protocol]
authResponseHeaders: [Authorization]
cors:
headers:
accessControlAllowOriginList: ["*"]
accessControlAllowMethods: [GET, OPTIONS]
accessControlAllowHeaders: [Authorization, Content-Type, Range, X-Api-Key]
addVaryHeader: true
strip-forwarded:
headers:
customRequestHeaders:
X-Forwarded-Uri: ""
X-Forwarded-Method: ""
services:
front:
loadBalancer:
servers: [{ url: "http://front:8901" }]
auth:
loadBalancer:
servers: [{ url: "http://auth:4568" }]
api:
loadBalancer:
servers: [{ url: "http://api:3567" }]
scanner:
loadBalancer:
servers: [{ url: "http://scanner:4389" }]
transcoder:
loadBalancer:
servers: [{ url: "http://transcoder:7666" }] Prefer a managed setup? WinterFlow installs, configures, and updates Kyoo for you using this same Docker Compose configuration.