OwnTube

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)

VariableDefaultDescription
AUTH_SECRETrequiredSecret for signing login sessions.
GATEWAY_SIGNING_KEYrequiredShared with the gateway; signs playback URLs. At least 32 characters.
GATEWAY_URLhttp://localhost:8080Where the web app reaches the gateway. The compose files set http://gateway:8080.
AUTH_URLunsetThe public URL of the server, e.g. https://tube.example.org. Set it behind a reverse proxy.
AUTH_TRUST_HOSTunsetSet to true behind a reverse proxy.
DATABASE_PATH/app/apps/web/data/owntube.dbLocation of the SQLite database inside the container.
LOG_LEVELinfodebug, info, warn or error.
TZUTCTime 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.

VariableDefaultDescription
OWNTUBE_WARM_INTERVAL_SEC900Seconds between refresh runs. 0 turns it off.
OWNTUBE_WARM_REGIONUSRegion for trending (two-letter country code).
OWNTUBE_WARM_LIMIT48Number of trending videos to keep.
OWNTUBE_WARM_VIDEO_LIMIT5Newest uploads per channel whose details are fetched ahead of time.
OWNTUBE_WARM_CHANNELS, …_CHANNEL_PAGES, …_SHORTS, …_RSS, …_VIDEOS, …_HOMEtrueTurn 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

VariableDefaultDescription
OWNTUBE_DEBUG_RECOMMENDATIONSunsetSet to 1 to log every recommendation score.
OWNTUBE_RECOMMENDATION_LOG_PATHlogs/recommendation-debug.ndjsonWhere those scores are written.

TV app updates

VariableDefaultDescription
OWNTUBE_TV_RELEASES_DIRdata/tv-releasesDirectory 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)

VariableDefaultDescription
GATEWAY_SIGNING_KEYrequiredMust match the web app's value.
GATEWAY_PORT8080Listening port.
GATEWAY_EGRESS_FAMILYipv4 in composeipv4, ipv6 or auto. YouTube flags whole IPv6 /64 ranges sooner than single IPv4 addresses, so IPv4 is the default.
GATEWAY_TRANSPORTautoauto uses regular stream URLs and falls back to SABR streaming when YouTube refuses them. sabr uses SABR from the start.
GATEWAY_PO_BROWSERunsetPath 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_URLunsetSend all YouTube traffic through this HTTP proxy.
GATEWAY_CACHE_DIR/data/cacheMetadata and image cache.
GATEWAY_IMAGE_CACHE_MAX_BYTES1073741824Image 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.