English
Get started
← All templates

Deploy PeerTube on Pethost in one click

Your own video platform in the fediverse: upload, stream and share videos

What happens

  1. You sign in to Pethost or make an account, with a passkey, GitHub or Google.
  2. No machine yet? You pick a plan, and we prepare one for you. The link waits in your browser until it is ready.
  3. New project opens at the app. You fill in what it asks for and click Create project: Email, Admin password.
  4. In a minute or two the app is live at its own address with HTTPS. Its secrets are made for it at random, and its data is in the nightly backup.
  5. It is a project like any other: its compose.yaml, its .env, its logs and a terminal are in the panel, and your agent can change it, roll it back or restore it.

First steps

Sign in as root with the admin password you gave; PeerTube reads it only at the first start. Sign-ups are closed until you enable them in the admin’s configuration, under General. PeerTube sends no email until SMTP_HOSTNAME, SMTP_USERNAME, SMTP_PASSWORD and SMTP_FROM are in the project’s .env and the project restarts. Videos are tied to this address for good, so give the project its final address before you upload. Transcoding takes the machine’s CPU while it runs. Videos and the config are kept in /data and /config.

What it runs

The template is this compose.yaml and the variables it writes into the project’s .env. Pethost runs the file as it is written.

# PeerTube's production docker-compose.yml without its nginx, certbot and postfix: the machine's
# proxy gives the address and HTTPS, and PeerTube serves its files itself.
services:
  peertube:
    image: chocobozzz/peertube:v8.3.1-trixie
    restart: unless-stopped
    environment:
      PEERTUBE_WEBSERVER_HOSTNAME: ${HOST}
      PEERTUBE_SECRET: ${PEERTUBE_SECRET}
      PEERTUBE_DB_HOSTNAME: postgres
      PEERTUBE_DB_USERNAME: peertube
      PEERTUBE_DB_PASSWORD: ${DB_PASSWORD}
      PEERTUBE_REDIS_HOSTNAME: redis
      PEERTUBE_ADMIN_EMAIL: ${ADMIN_EMAIL}
      # Read once, when the first start makes the user root.
      PT_INITIAL_ROOT_PASSWORD: ${ADMIN_PASSWORD}
      # Empty until SMTP_HOSTNAME and the rest are put into .env: then PeerTube sends mail.
      PEERTUBE_SMTP_HOSTNAME: ${SMTP_HOSTNAME:-}
      PEERTUBE_SMTP_PORT: ${SMTP_PORT:-587}
      PEERTUBE_SMTP_USERNAME: ${SMTP_USERNAME:-}
      PEERTUBE_SMTP_PASSWORD: ${SMTP_PASSWORD:-}
      PEERTUBE_SMTP_FROM: ${SMTP_FROM:-}
      PEERTUBE_SMTP_TLS: ${SMTP_TLS:-false}
      PEERTUBE_SMTP_DISABLE_STARTTLS: "false"
    volumes:
      - data:/data
      - config:/config
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy

  postgres:
    image: postgres:17
    restart: unless-stopped
    environment:
      POSTGRES_USER: peertube
      POSTGRES_DB: peertube
      POSTGRES_PASSWORD: ${DB_PASSWORD}
    volumes:
      - db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "peertube"]
      interval: 5s
      timeout: 5s
      retries: 10

  redis:
    image: redis:7.4
    restart: unless-stopped
    volumes:
      - redis:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 5s
      retries: 10

volumes:
  data:
  config:
  db:
  redis: