Skip to content

Quickstart ​

One command brings up the core stack, sets up the gateway routes and prints the portal URLs with the first-boot admin. Measured on 2026-09-30 (Apple-silicon laptop, Docker Desktop, base images already pulled, no Gatez build cache): 6 minutes 7 seconds for the first make up including the image build, 34 seconds on every later run; the clone itself took 80 seconds.

Prerequisites ​

RequirementMinimumCheck
Docker24.0+docker --version
Docker Composev2.20+docker compose version
RAM8 GB for the core, 16 GB with every profile—
git, curl, makeanygit --version, curl --version, make --version
python33.8+python3 --version (the scripts parse JSON with it)

Step 1: Clone and configure ​

bash
git clone <your clone URL> gatez
cd gatez
cp .env.example .env

The defaults work locally. Two things worth knowing before the first start:

  • CLICKHOUSE_PASSWORD must stay empty locally (the compose ClickHouse server enforces none; a value makes the migrate step refuse the stack).
  • To choose the admin account yourself, set GATEZ_ADMIN_EMAIL and GATEZ_ADMIN_PASSWORD now. Otherwise a password is generated and printed once.

LLM provider keys (OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY) are optional; without them the AI gateway serves the local Ollama model only.

DANGER

Never commit .env. The pre-commit hook blocks it.

Step 2: make up ​

bash
make up

What it does, in order:

  1. docker compose up -d --wait — the core class: etcd, APISIX, Redis, ClickHouse, the migrate one-shot (applies the schema and its migrations, then exits 0), the AI gateway, the agent gateway, the Control Plane API and both portals. Every service waits for its dependencies' health checks.
  2. scripts/setup-routes.sh — the APISIX fallback routes (/api/* → Control Plane API, /v1/* → AI gateway, plus health).
  3. The NovaTrust demo seed, only when the demo profile is running (see Step 5); otherwise a hint.
  4. The access summary:
  Operator Portal   http://localhost:3003
  Developer Portal  http://localhost:3004
  Control Plane API http://localhost:4001   (APISIX http://localhost:9080, admin :9180)
  Admin (first boot) email: admin@gatez.local   password: bKfcHSMJxs3B7cSGaa9Rh3XC
  → sign in to the Operator Portal and change it now (forced at first login; anyone who can read the log can use it)
make up: 34s

Running a service natively (cargo run) needs GATEZ_ENV=local in the environment: compose sets it for you, and an unset or misspelt value runs fail-closed with production rules (no dev conveniences, default secrets refused).

make up is idempotent: run it again after a reboot or a make down and it re-checks health, re-applies the routes and prints the summary again. The credentials line appears until the admin password has been changed (the first sign-in forces it); after that make creds says "already signed in".

Plain docker compose up -d starts the core only, without routes or the summary.

Step 3: Sign in ​

Open http://localhost:3003, sign in with the printed credentials and set a new password when asked. The Operator Portal is the platform team's view (tenants, APIs, rate limits, approvals, health). The Developer Portal at http://localhost:3004 is the tenant view, scoped to the signed-in tenant.

Authentication is built in (EdDSA-signed sessions from the Control Plane API, checked against Redis on every request). A federated identity provider is optional; see Step 6.

Step 4: First API call ​

The same login works against the API. Sign in, change the temporary password (every other route answers 403 password_change_required until then), then list tenants. The password change revokes the token you signed in with and returns a fresh one, so the block captures it:

bash
API=http://localhost:4001
PW='<the printed password>'
NEW='a-new-long-password-2026'          # 12+ characters
TOKEN=$(curl -s -X POST $API/api/auth/login -H 'Content-Type: application/json' \
  -d "{\"email\":\"admin@gatez.local\",\"password\":\"$PW\"}" | python3 -c 'import json,sys; print(json.load(sys.stdin)["access_token"])')

# first login only: rotate the password; the response carries the new session
TOKEN=$(curl -s -X POST $API/api/auth/password -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d "{\"current_password\":\"$PW\",\"new_password\":\"$NEW\"}" | python3 -c 'import json,sys; print(json.load(sys.stdin)["access_token"])')

curl -s $API/api/auth/me -H "Authorization: Bearer $TOKEN" | python3 -m json.tool
curl -s $API/api/tenants  -H "Authorization: Bearer $TOKEN" | python3 -m json.tool

Through the gateway the same call is http://localhost:9080/api/tenants (the /api/* fallback route proxies to the Control Plane API). Tenant API keys are created in the Developer Portal and checked by APISIX's key-auth.

Step 5: Optional profiles ​

make up starts only the core. Profiles add the rest, through COMPOSE_PROFILES in .env or the shell:

ProfileAddsTry
demomock backend upstream, second agent gateway, Qdrant, landing page; make demo also seeds the NovaTrust scenario: tenants retail, wealth, insurance, payflow, routes, keys, tool serversmake demo
observabilityPrometheus :9090, Grafana :3002 (admin/admin), Jaeger :16686, OTel collectorCOMPOSE_PROFILES=observability make up
ssoZitadel identity provider (:8085) — pair it with GATEZ_SSO_FEDERATION=trueStep 6
bash
make demo          # ≈15 s on top of a running core; then run the smoke test with real upstreams:
SMOKE_REQUIRE_DEMO=1 make smoke

Step 6: Federated login (optional, not yet verified end to end) ​

Built-in auth is the default and needs no identity provider. Zitadel can be added on top; the order matters, because a portal started with SSO on and no client id refuses to start:

bash
# 1. .env: start the identity provider with federation still OFF
COMPOSE_PROFILES=sso            # or observability,demo,sso
GATEZ_SSO_FEDERATION=false
make up

# 2. provision: on a fresh instance the setup token was written to a volume at first start and is picked up
#    automatically; for an instance that predates it, create a PAT in the console (http://localhost:8085) for a
#    service user with IAM owner and pass ZITADEL_PAT=<token>
scripts/zitadel-setup.sh                       # project, OIDC apps, demo users (developer machines only); writes ZITADEL_*_CLIENT_ID to .env
                                               # and revokes the one-time setup token (re-runs: ZITADEL_PAT=…)

# 3. .env: switch federation on, then restart — the portals read the client ids at start (runtime /config.json)
GATEZ_SSO_FEDERATION=true
make up

scripts/test-sso-setup.sh --live runs this sequence end to end against a temporary env file and restores the stack afterwards. With federation off, any identity-provider token is refused with 401 sso_not_configured and the portals show the password form only. The runtime portal configuration (GATEZ_API_URL, GATEZ_SSO_*) is documented in Authentication.

Service endpoints ​

ServiceURLAuth
Operator Portalhttp://localhost:3003built-in login
Developer Portalhttp://localhost:3004built-in login
Control Plane APIhttp://localhost:4001session token (or master key for service calls)
APISIX proxyhttp://localhost:9080per route
APISIX admin APIhttp://localhost:9180X-API-KEY (APISIX_ADMIN_KEY)
AI gateway (direct)http://localhost:4000bypasses L1
Agent gateway (direct)http://localhost:5001bypasses L1
ClickHouse HTTPhttp://localhost:8123none locally
Grafana / Prometheus / Jaeger:3002 / :9090 / :16686observability profile
Zitadel consolehttp://localhost:8085sso profile

Local mode is not a security boundary

Local ports bind on all interfaces with development defaults, and with GATEZ_ENV=local the Control Plane API, the AI gateway and the agent gateway accept a request that carries an X-Tenant-ID header and no token as a tenant user of that tenant. APISIX's /api/* and /v1/* fallback routes add X-Tenant-ID: __default__ when none is given, so token-less calls through :9080 succeed, and anyone who can reach the ports can name any tenant. With the sso profile and federation on, GATEZ_DEV_AUTH_BYPASS (default true in the base compose) additionally accepts any non-Gatez bearer as a platform admin. None of this applies outside local, and the prod overlay pins the bypass off. Keep a local stack on a private network.

Everyday commands ​

bash
make ps            # status
make logs          # follow the core services
make smoke         # scripts/smoke-test.sh
make test-compose  # compose profiles / image / prod overlay contract test
make down          # stop everything, keep data (Redis users and keys, ClickHouse, routes)
make reset         # stop and DELETE volumes — asks for confirmation

Troubleshooting ​

make up stops at "the stack did not become healthy" ​

Run docker compose ps -a. The usual causes:

  • migrate exited non-zero: docker compose logs migrate names the failing migration or a ClickHouse auth refusal (a non-empty CLICKHOUSE_PASSWORD).
  • control-plane-api restarting: docker compose logs control-plane-api. Outside GATEZ_ENV=local it refuses to start without STS_ED25519_PRIVATE_DER_B64; locally an invalid GATEZ_ADMIN_EMAIL/GATEZ_ADMIN_PASSWORD before the first admin exists fails the start with the reason.
  • First build still running: image builds take 3–5 minutes.

I lost the admin password ​

Until the password has been changed, make creds prints it again. After the change it is never shown again; a break-glass reset is tracked (see Authentication). Locally, make reset starts from scratch (deletes all data).

Port conflicts ​

Gatez uses non-default ports (Redis 6380, Zitadel 8085, Grafana 3002). Running a portal with npm run dev on 3003/3004 too? Move the containers: OPERATOR_PORT=3013 DEVELOPER_PORT=3014 make up, and open them as localhost (the API's CORS allowlist follows those ports).

APISIX returns 502 or 503 ​

The upstream is not running: /smoke/* needs the demo profile's mock backend; /v1/* needs the AI gateway healthy. docker compose ps ai-gateway mock-backend.

AI gateway returns 503 or "no models available" ​

No provider key is configured. Add one to .env and docker compose up -d ai-gateway, or run Ollama on the host (local-llm is always listed).

Container builds fail ​

Give Docker at least 4 GB of memory for the Rust builds, then docker compose build ai-gateway agent-gateway control-plane-api. Built images carry their registry names (ghcr.io/sameerdeshmukh/gatez/<service>:local); nothing is pushed. CI publishes images only for the Rust services whose layer changed in a commit (portals not yet): GATEZ_IMAGE_TAG=<sha> with docker compose pull --ignore-pull-failures fetches those and up builds the rest (see .env.example).

Resetting everything ​

bash
make reset
make up

Next steps ​

Changing the platform admin's e-mail (W2-D7-69.a) ​

GATEZ_ADMIN_EMAIL is read once: the first boot creates the platform admin and later boots skip it while a platform admin exists. To move that account (or any local account) to a new address, run on the host:

bash
REDIS_PASSWORD=<host redis password> scripts/change-local-user-email.sh old@example.com new@example.com --dry-run
REDIS_PASSWORD=<host redis password> scripts/change-local-user-email.sh old@example.com new@example.com

It rewrites the user record and the e-mail index in one Redis transaction, bumps the credential's session_version (every session and refresh token of the account dies), and keeps the password. Then update GATEZ_ADMIN_EMAIL in the host .env so a future fresh install bootstraps the same address. An API/portal action for this is tracker row W2-D7-69.b.

Enterprise API + AI + Agent Gateway