Get started
Quickstart: self-host with docker compose
Run PostgreSQL, Redis, the API, gateway, worker and console on one machine with docker compose.
The repository's docker-compose.yml runs the data stores for development and, with the full profile, every
GebSecure service from the same hardened images used in production (non-root, read-only root filesystem, no
Linux capabilities). For Kubernetes, see Deployment and the Helm chart in
infra/helm/gebsecure.
Requirements: Node.js ≥ 22.12 (for the setup script) and Docker with Compose v2.
1. Set up configuration, data stores and a development organization#
git clone https://github.com/gebsecure/gebsecure.git && cd gebsecure
npm run setupnpm run setup (scripts/setup.mjs):
- checks Node.js and Docker and installs dependencies;
- creates
.envfrom.env.exampleand fills in freshly generated development secrets (TOKEN_SIGNING_KEYS,COOKIE_SECRET,MASTER_KEY,VAULT_FINGERPRINT_KEY); - starts PostgreSQL 16 and Redis 7 with docker compose and waits until they are healthy;
- creates the database, verifies that the runtime role
gebsecure_appcannot bypass row-level security and runs the migrations; - seeds the organization
gebsecure-devwith a sample agent (sample-support-agent, with a client secret) and a deployed sample policy.
It prints the console login admin@gebsecure.local with its password and the agent's client id and secret —
once; store them. Re-running is safe: existing secrets in .env are never overwritten. Flags:
--skip-docker (use running PostgreSQL/Redis), --skip-seed, --skip-install.
Images are pulled from mirror.gcr.io by default (IMAGE_REGISTRY, IMAGE_MIRROR in .env).
2. Start the services#
From source with hot reload (development):
npm run dev # api :4000 · gateway :4100 · worker :4200 · console http://localhost:5173Or the complete stack from the production images:
docker compose --profile full up -d --buildThe full profile builds the api, gateway, worker, migrate and console images from
infra/docker/Dockerfile and infra/docker/Dockerfile.console, runs the one-shot migrate service before any
service starts, and adds Mailpit as an SMTP sink for approval emails (UI at http://localhost:8025). The
services read .env; inside the compose network DATABASE_URL, REDIS_URL and SMTP_URL point at the
postgres, redis and mailpit containers, and only the worker gets the schema-owner DATABASE_ADMIN_URL.
| Service | Port | Health |
|---|---|---|
| api | 4000 (API_HOST_PORT) |
GET /healthz, GET /readyz; Swagger UI at /docs outside production |
| gateway | 4100 (GATEWAY_HOST_PORT) |
GET /healthz, GET /readyz |
| worker | 4200 (WORKER_HOST_PORT) |
GET /healthz, GET /readyz |
| console | 5173 (CONSOLE_HOST_PORT) |
— |
| postgres / redis | 5432 / 6379 | container health checks |
3. Verify#
Exchange the seeded agent's client secret for an access token and ask for a decision — the commands
npm run setup prints:
TOKEN=$(curl -s http://localhost:4000/v1/auth/token -H 'content-type: application/json' \
-d '{"grant_type":"client_credentials","client_id":"<client_id>","client_secret":"<client_secret>"}' | jq -r .access_token)
curl -s http://localhost:4100/v1/authorize -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
-d '{"action":"github:repos.get","resource":"repo:acme/web"}'No policy permits github:repos.get yet, so the decision is DENY (default deny). Sign in to the console at
http://localhost:5173 to see the decision in the audit log, then continue with the
TypeScript or Python quickstart.
Configuration#
Every setting is declared and validated in packages/config/src/index.ts; .env.example documents them. The
ones you are most likely to change:
| Variable | Default | Purpose |
|---|---|---|
GEBSECURE_ENV |
development |
development, test, staging or production; staging and production refuse to start on development defaults |
PUBLIC_API_URL, PUBLIC_GATEWAY_URL, PUBLIC_CONSOLE_URL |
http://localhost:4000 / :4100 / :5173 |
externally visible URLs (token audience, approval links, MCP metadata) |
CORS_ORIGINS |
http://localhost:5173 |
browser origins allowed to call the API |
REGION |
local |
deployment region; organizations of another region get wrong_region (see troubleshooting) |
OTHER_REGIONS |
empty | other regional deployments offered at sign-up, code=consoleUrl pairs separated by commas (e.g. eu=https://console.eu.example.com) |
KMS_PROVIDER |
local |
local, aws, gcp or azure key-encryption key for the vault (key management) |
ACCESS_TOKEN_TTL, REFRESH_TOKEN_TTL, SESSION_IDLE_TTL |
10m, 30d, 12h |
token and session lifetimes |
RATE_LIMIT_AUTH_PER_MINUTE, RATE_LIMIT_TOKEN_PER_MINUTE |
20, 120 |
per-principal rate limits |
GATEWAY_WORKERS |
1 (2 in compose) |
Node cluster workers per gateway container (0 = one per CPU) |
EXECUTION_ALLOW_PRIVATE_NETWORKS |
false |
let the broker reach private and loopback addresses — development only, refused in staging/production |
SMTP_URL, EMAIL_FROM |
Mailpit | approval and alert emails |
DETECTION_MODEL_PROVIDER |
none |
anthropic enables the model-assisted prompt-injection classifier (with DETECTION_MODEL_API_KEY) |
ASSISTANT_MODEL_PROVIDER |
none |
anthropic enables the AI onboarding assistant (with ASSISTANT_MODEL_API_KEY, or the detection key when unset); each organization also turns it on in its settings. ASSISTANT_MODEL (claude-opus-5-5), ASSISTANT_DRAFTS_PER_HOUR (60 per organization) |
Secret settings also accept <NAME>_FILE=/path (Docker and Kubernetes secrets). Never commit .env.
Stop and reset#
docker compose --profile full down # stop (data is kept in the pgdata/redisdata volumes)
docker compose --profile full down -v # stop and delete the volumes