Skip to content

Installation

OwnTube runs as two containers, the web app and the gateway, built from source with Docker Compose. Most of the time goes into the first build.

  1. Get the code

    Terminal window
    git clone https://github.com/mdbraber/owntube.git
    cd owntube
  2. Create the secrets

    OwnTube needs two random secrets in a .env file next to docker-compose.yml:

    Variable Used for
    AUTH_SECRET Signing login sessions.
    GATEWAY_SIGNING_KEY Signing playback URLs. Shared by the web app and the gateway; at least 32 characters.
    Terminal window
    printf 'AUTH_SECRET=%s\nGATEWAY_SIGNING_KEY=%s\n' \
    "$(openssl rand -base64 48)" "$(openssl rand -base64 48)" > .env
    chmod 600 .env

    Keep both values. A new AUTH_SECRET signs everyone out; a new GATEWAY_SIGNING_KEY invalidates playback URLs already handed out.

  3. Build and start

    Terminal window
    docker compose up -d --build

    The gateway starts first. The web app waits until the gateway reports healthy, applies its database migrations and listens on port 3000. Follow it with:

    Terminal window
    docker compose ps
    docker compose logs -f app gateway
  4. Create your account

    Open http://<server>:3000/register. Everyone who uses the server gets their own account.

  5. Bring your history

    Under Settings → Import & export, import watch-history.json or watch-history.html from a Google Takeout export of YouTube. The recommender uses it right away.

    Subscribe to channels from their channel pages. Moving from another OwnTube server? Import its JSON export on the same page.

Volume Contents
owntube-data The SQLite database (owntube.db) and TV releases. Back this up.
owntube-gateway The gateway’s metadata and image cache. Safe to delete; it is rebuilt.

To keep the data in a host directory, replace the named volumes with bind mounts, as docker-compose.unraid.yml does. A bind-mounted gateway directory must be writable by the container’s node user (uid 1000).