Docs / Self-hosting
Operations
Health checks, administrator commands, backup, restore and upgrades.
Health
curl -fsS http://127.0.0.1:8001/health # process is up
curl -fsS http://127.0.0.1:8001/ready # check "status" in the body
curl -fsS http://127.0.0.1:8001/version
docker compose ps/ready returns 200 either way. Read its status field.
Administrators
docker compose exec rai-gateway rai-gateway admin list
docker compose exec rai-gateway rai-gateway admin reset-password --email [email protected]
docker compose exec rai-gateway rai-gateway admin deactivate --email [email protected]Back up
Back up the database, the onboarding source files and .env together. Store .env encrypted and separately.
stamp=$(date -u +%Y%m%dT%H%M%SZ)
docker compose stop rai-onboarding-worker
docker compose exec -T postgres pg_dump -U rai_user -d rai_gateway --format=custom > "rai-db-$stamp.dump"
docker compose exec -T rai-gateway tar -czf - -C /var/lib/rai/onboarding-sources . > "rai-sources-$stamp.tar.gz"
docker compose start rai-onboarding-workerRestore
Restore replaces the current data.
docker compose stop control-plane-ui rai-onboarding-worker rai-gateway
docker compose exec -T postgres pg_restore -U rai_user -d rai_gateway \
--clean --if-exists --exit-on-error < rai-db-YYYYMMDDTHHMMSSZ.dump
docker compose run --rm --no-deps -T --entrypoint tar rai-gateway \
-xzf - -C /var/lib/rai/onboarding-sources < rai-sources-YYYYMMDDTHHMMSSZ.tar.gz
docker compose up -dUse the same EVIDENCE_ENCRYPTION_KEY as the backed-up instance. If you run the events worker, stop and start it with the others.
Upgrade
- Read the release notes and compare
.envwith the new template. - Back up.
- Run
git pull, thendocker compose up -d --build. Migrations run at API startup. - Check
/readyand sign in.
To roll back, check out the previous version, rebuild and restore the backup.