Updates and backups
Update
Section titled “Update”cd owntubegit pulldocker compose up -d --buildCompose rebuilds both images and recreates the containers whose image changed. The web app applies database migrations when it starts. Videos that are playing stop only if the gateway itself is recreated.
Keep a way back
Section titled “Keep a way back”Tag the running images before you rebuild:
rev=$(git rev-parse --short HEAD)docker tag owntube-app:latest owntube-app:pre-$revdocker tag owntube-gateway:latest owntube-gateway:pre-$revImage names start with the Compose project name, which is the directory name by default; docker images | grep owntube lists them. To go back, retag the saved images as latest and run docker compose up -d. Migrations only add to the database, but take a backup before a large update anyway.
Back up
Section titled “Back up”Everything worth keeping is in the SQLite database in the owntube-data volume. SQLite’s online backup is safe while OwnTube runs:
docker compose exec app node -e " const Database = require('better-sqlite3'); new Database(process.env.DATABASE_PATH) .backup('/app/apps/web/data/backup.db') .then(() => console.log('ok'));"docker compose cp app:/app/apps/web/data/backup.db ./owntube-$(date +%F).dbRun it from cron for a daily backup. The gateway’s volume is a cache and needs no backup.
Restore
Section titled “Restore”docker compose stop appdocker compose run --rm --no-deps app \ rm -f /app/apps/web/data/owntube.db-wal /app/apps/web/data/owntube.db-shmdocker compose cp ./owntube-2026-11-27.db app:/app/apps/web/data/owntube.dbdocker compose start appThe database runs in WAL mode. Removing the old -wal and -shm files keeps them from being applied to the restored copy.
Move to another server
Section titled “Move to another server”Restore a backup on the new server and copy .env along with it. With the same AUTH_SECRET nobody has to sign in again. Paired TVs and iPhones keep working once the address they use points to the new server.