Configuration
OwnTube is configured with environment variables, set in .env or in the environment: block of each service in docker-compose.yml. Per-user preferences live in the app under Settings.
After changing a variable, apply it with docker compose up -d.
Web app (app)
| Variable | Default | Description |
|---|---|---|
AUTH_SECRET | required | Secret for signing login sessions. |
GATEWAY_SIGNING_KEY | required | Shared with the gateway; signs playback URLs. At least 32 characters. |
GATEWAY_URL | http://localhost:8080 | Where the web app reaches the gateway. The compose files set http://gateway:8080. |
AUTH_URL | unset | The public URL of the server, e.g. https://tube.example.org. Set it behind a reverse proxy. |
AUTH_TRUST_HOST | unset | Set to true behind a reverse proxy. |
DATABASE_PATH | /app/apps/web/data/owntube.db | Location of the SQLite database inside the container. |
LOG_LEVEL | info | debug, info, warn or error. |
TZ | UTC | Time zone for logs. |
Background refresh
The web app refreshes trending, subscriptions, channel pages and the newest uploads in the background, so pages open from cache.
| Variable | Default | Description |
|---|---|---|
OWNTUBE_WARM_INTERVAL_SEC | 900 | Seconds between refresh runs. 0 turns it off. |
OWNTUBE_WARM_REGION | US | Region for trending (two-letter country code). |
OWNTUBE_WARM_LIMIT | 48 | Number of trending videos to keep. |
OWNTUBE_WARM_VIDEO_LIMIT | 5 | Newest uploads per channel whose details are fetched ahead of time. |
OWNTUBE_WARM_CHANNELS, …_CHANNEL_PAGES, …_SHORTS, …_RSS, …_VIDEOS, …_HOME | true | Turn individual parts of the refresh off with false. |
Every refresh costs requests to YouTube. On a host that gets rate-limited, raise the interval before anything else.
Recommendations
| Variable | Default | Description |
|---|---|---|
OWNTUBE_DEBUG_RECOMMENDATIONS | unset | Set to 1 to log every recommendation score. |
OWNTUBE_RECOMMENDATION_LOG_PATH | logs/recommendation-debug.ndjson | Where those scores are written. |
TV app updates
| Variable | Default | Description |
|---|---|---|
OWNTUBE_TV_RELEASES_DIR | data/tv-releases | Directory with TV APKs and update.json. See TV updates. |
Variables for podcast feeds, hooks and webhooks are described in Podcast feeds, hooks and tokens.
Gateway (gateway)
| Variable | Default | Description |
|---|---|---|
GATEWAY_SIGNING_KEY | required | Must match the web app's value. |
GATEWAY_PORT | 8080 | Listening port. |
GATEWAY_EGRESS_FAMILY | ipv4 in compose | ipv4, ipv6 or auto. YouTube flags whole IPv6 /64 ranges sooner than single IPv4 addresses, so IPv4 is the default. |
GATEWAY_TRANSPORT | auto | auto uses regular stream URLs and falls back to SABR streaming when YouTube refuses them. sabr uses SABR from the start. |
GATEWAY_PO_BROWSER | unset | Path to a Chromium binary for proof-of-origin tokens, for when YouTube demands attestation. Needs an image built with --build-arg WITH_PO_BROWSER=true; then set /usr/bin/chromium. |
GATEWAY_PROXY_URL | unset | Send all YouTube traffic through this HTTP proxy. |
GATEWAY_CACHE_DIR | /data/cache | Metadata and image cache. |
GATEWAY_IMAGE_CACHE_MAX_BYTES | 1073741824 | Image cache size kept by the hourly cleanup (1 GiB). |
Building the gateway with the PO-token browser
services:
gateway:
build:
context: .
dockerfile: apps/gateway/Dockerfile
args:
WITH_PO_BROWSER: "true"
environment:
GATEWAY_PO_BROWSER: /usr/bin/chromium
Per-user settings
Under Settings in the app, each account sets its own appearance, navigation, playback quality and autoplay, caption language, feed behaviour, swipe gestures, SponsorBlock categories, home page blocks and API tokens. The TV and iPhone apps read the same settings.