Skip to content

Self-host with Docker Compose

This guide stands up a self-contained SupaCloud — server, web UI, and PostgreSQL — on a single host using the standalone Compose overlay. It is the Tier 0 evaluation / small self-hosted path: local Postgres, builtin auth, secrets from a .env file.

The standalone overlay reads secrets from .env. Start from the committed example and edit it:

Terminal window
cp .env.example.standalone .env

The two values you must change before exposing anything:

Variable Why
SUPACLOUD_JWT_SECRET Signs sessions. Must be at least 32 bytes of random data.
POSTGRES_PASSWORD The database password (and the matching DATABASE_URL).

Also set SUPACLOUD_INITIAL_ADMIN_EMAILS to the email that should become the first owner. For a purely local trial, the example’s MODE=dev, PUBLIC_URL=http://localhost:8080, and AUTH_COOKIE_SECURE=false are fine; for anything reachable, set a real PUBLIC_URL and turn cookie security on.

The standalone file is an overlay on the base docker-compose.yml — pass both, base first:

  1. Build and start in the background:

    Terminal window
    docker compose -f docker-compose.yml -f compose.standalone.yml up -d --build
  2. Watch the services become healthy:

    Terminal window
    docker compose -f docker-compose.yml -f compose.standalone.yml ps

    Postgres has a health check; the server waits for it before starting and runs its migrations on boot.

The stack exposes two ports:

Service URL Purpose
Web UI http://localhost:3001 The operator console you sign in to.
Server API http://localhost:8080 The HTTP + Management API the UI calls.

Open http://localhost:3001 and sign in with the address you set in SUPACLOUD_INITIAL_ADMIN_EMAILS. With builtin auth, that email is provisioned as the owner of a personal organization and its first workspace. You should land on the cockpit:

The SupaCloud dashboard after first sign-in.The SupaCloud dashboard after first sign-in.

From here, follow Your first agent run.

Terminal window
# Tail logs
docker compose -f docker-compose.yml -f compose.standalone.yml logs -f server
# Stop (keeps the postgres-data volume)
docker compose -f docker-compose.yml -f compose.standalone.yml down
# Stop and delete data
docker compose -f docker-compose.yml -f compose.standalone.yml down -v

Database state lives in the postgres-data volume, so a plain down/up keeps your workspaces, runs, and secrets.

Production: the base compose and its database roles

Section titled “Production: the base compose and its database roles”

The standalone overlay is a single-role trial: the server connects as the database superuser, which a MODE=prod server refuses (see Run as a least-privilege database role). For production, start from .env.example with the base docker-compose.yml alone. On the first start its Postgres creates three roles (docker/postgres/initdb/10-supacloud-roles.sh):

Variable Role Used for
POSTGRES_ADMIN_PASSWORD pgadmin, the bootstrap superuser Initialising the cluster. Remove the line from .env after the first start and keep the password in your password manager, so the server container, which also loads .env, never holds it.
POSTGRES_PASSWORD supacloud, the runtime role (no SUPERUSER, no BYPASSRLS) DATABASE_URL
POSTGRES_MIGRATOR_PASSWORD supacloud_migrator, a member of the schema owner supacloud_owner SUPACLOUD_MIGRATION_DATABASE_URL, which assumes supacloud_owner through options=-c role=supacloud_owner

The roles are created only when the data directory is empty. An existing volume created before this layout keeps supacloud as its superuser; split it with the least-privilege guide before you set MODE=prod.