PeerTube
A free, decentralized and federated video platform
Alternative to: youtube, vimeo, dailymotion
PeerTube is a free, decentralized, and federated video platform developed as an alternative to platforms like YouTube, Dailymotion, and Vimeo that centralize data and attention. It lets you upload, live-stream, and share videos across independent instances that interoperate over ActivityPub with the wider fediverse, while peer-to-peer WebRTC delivery reduces the load on any single server.
PeerTube Docker Compose example
Self-host PeerTube on your own server, homelab, or VPS starting from this Docker Compose example.
It runs PeerTube in Docker containers using the official chocobozzz/peertube:production, postgres:17-alpine, redis:8-alpine 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.
services:
peertube:
image: chocobozzz/peertube:production
restart: unless-stopped
depends_on:
- postgres
- redis
volumes:
- data:/data
- config:/config
environment:
# Public hostname of the instance (no scheme, no port), e.g. videos.example.com.
# Cannot be changed after the first start without breaking federation.
PEERTUBE_WEBSERVER_HOSTNAME: "localhost"
# Public port users reach PeerTube on. Use 443 behind an HTTPS reverse proxy.
PEERTUBE_WEBSERVER_PORT: "9000"
# Whether the public URL uses HTTPS. Use true behind an HTTPS reverse proxy.
PEERTUBE_WEBSERVER_HTTPS: "false"
# Server secret used to sign tokens. Generate one with: openssl rand -hex 32
PEERTUBE_SECRET: "changeme"
# Password of the initial "root" admin account. Leave empty to have one generated and printed in the logs on first start.
PT_INITIAL_ROOT_PASSWORD: ""
# Email address of the instance administrator.
PEERTUBE_ADMIN_EMAIL: "admin@example.com"
# PostgreSQL connection (points at the bundled postgres service).
PEERTUBE_DB_HOSTNAME: "postgres"
PEERTUBE_DB_USERNAME: "peertube"
PEERTUBE_DB_PASSWORD: "peertube"
PEERTUBE_DB_SSL: "false"
# Redis host (points at the bundled redis service).
PEERTUBE_REDIS_HOSTNAME: "redis"
# SMTP server hostname. Leave empty to disable outgoing email.
PEERTUBE_SMTP_HOSTNAME: ""
# SMTP server port.
PEERTUBE_SMTP_PORT: "587"
# SMTP username.
PEERTUBE_SMTP_USERNAME: ""
# SMTP password.
PEERTUBE_SMTP_PASSWORD: ""
# Use implicit TLS (port 465). Leave false for STARTTLS on 587.
PEERTUBE_SMTP_TLS: "false"
# Disable STARTTLS upgrades (only for plain-text internal relays).
PEERTUBE_SMTP_DISABLE_STARTTLS: "false"
# Sender address for outgoing emails, e.g. noreply@videos.example.com.
PEERTUBE_SMTP_FROM: "noreply@example.com"
# Log verbosity: debug, info, warn or error.
PEERTUBE_LOG_LEVEL: "info"
postgres:
image: postgres:17-alpine
restart: unless-stopped
volumes:
- db_data:/var/lib/postgresql/data
environment:
# Internal database credentials (only reachable inside the compose network).
POSTGRES_USER: "peertube"
POSTGRES_PASSWORD: "peertube"
POSTGRES_DB: "peertube"
redis:
image: redis:8-alpine
restart: unless-stopped
volumes:
- redis_data:/data
volumes:
data:
config:
db_data:
redis_data:
Values set to changeme are required — replace them with your own
values before starting PeerTube.
Prefer a managed setup? WinterFlow installs, configures, and updates PeerTube for you using this same Docker Compose configuration.