Operations
Day-2 concerns for a self-hosted UIGraph instance. All commands run from the uigraph-deploy/ directory.
Boot sequence
On startup uigraph-api performs, in order:
- Connect to Postgres.
- Apply pending SQL migrations (embedded in the image, tracked in a
schema_migrationstable). - Bootstrap the
defaultorg + admin user, idempotent, skipped if any org already exists. - Start the HTTP server and report healthy on
/healthz.
The uigraph-graphql, uigraph-gateway, and uigraph-ui services declare depends_on the API's health check, so they start only once the API reports healthy (after migrations + bootstrap).
Common tasks
make docker-ps # service status
docker compose logs -f uigraph-api # follow API logs
make docker-down # stop the stack (volumes preserved)
make docker-reset # wipe volumes and start fresh (re-runs migrations)
Upgrades
The images are pinned to the latest tag. Pull the new images and recreate the containers; migrations run automatically on the next API boot.
docker compose pull
make docker-up
Backups
Durable state lives in the three Docker volumes declared in docker-compose.yml:
postgres-data: the database (all application data).minio-data: object storage (screenshots, diagram images, uploads).redis-data: cache + queue (regenerable, but backing it up avoids a cold cache on restore).
Back these volumes up on your normal schedule. The application containers hold no state and can be recreated freely. If you repoint POSTGRES_URL or the STORAGE_* variables at managed services, rely on their backup tooling instead.
Going to production
The bundled docker-compose.yml is tuned for local evaluation: it serves plain HTTP, publishes every service port to the host, and ships placeholder secrets. Before running it anywhere shared:
- Replace every secret:
UIGRAPH_SECRET_KEYandSTORAGE_SECRET_KEYwithopenssl rand -hex 32, and thedevpasswordPostgres/MinIO passwords. Update the matching references inPOSTGRES_URLand theSTORAGE_*blocks. - Terminate TLS: put the stack behind your own reverse proxy or load balancer (nginx, Caddy, a cloud LB) that terminates HTTPS and forwards to
uigraph-uion port3000. SetUIGRAPH_DOMAIN,UIGRAPH_PUBLIC_URL, andUIGRAPH_FRONTEND_URLto the publichttps://URL. Serving over HTTPS is required for the session cookie'sSecureflag and for SSO, see Authentication & SSO. - Close unneeded ports: only the UI (and MinIO's public endpoint, so browsers can fetch asset URLs) needs to be reachable. Remove the
ports:entries for Postgres, the API, GraphQL, and the gateway, or bind them to127.0.0.1.