Appearance
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
| Requirement | Minimum | Check |
|---|---|---|
| Docker | 24.0+ | docker --version |
| Docker Compose | v2.20+ | docker compose version |
| RAM | 8 GB for the core, 16 GB with every profile | — |
| git, curl, make | any | git --version, curl --version, make --version |
| python3 | 3.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 .envThe defaults work locally. Two things worth knowing before the first start:
CLICKHOUSE_PASSWORDmust stay empty locally (the compose ClickHouse server enforces none; a value makes themigratestep refuse the stack).- To choose the admin account yourself, set
GATEZ_ADMIN_EMAILandGATEZ_ADMIN_PASSWORDnow. 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 upWhat it does, in order:
docker compose up -d --wait— the core class: etcd, APISIX, Redis, ClickHouse, themigrateone-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.scripts/setup-routes.sh— the APISIX fallback routes (/api/*→ Control Plane API,/v1/*→ AI gateway, plus health).- The NovaTrust demo seed, only when the demo profile is running (see Step 5); otherwise a hint.
- 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: 34sRunning 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.toolThrough 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:
| Profile | Adds | Try |
|---|---|---|
demo | mock backend upstream, second agent gateway, Qdrant, landing page; make demo also seeds the NovaTrust scenario: tenants retail, wealth, insurance, payflow, routes, keys, tool servers | make demo |
observability | Prometheus :9090, Grafana :3002 (admin/admin), Jaeger :16686, OTel collector | COMPOSE_PROFILES=observability make up |
sso | Zitadel identity provider (:8085) — pair it with GATEZ_SSO_FEDERATION=true | Step 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 smokeStep 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 upscripts/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
| Service | URL | Auth |
|---|---|---|
| Operator Portal | http://localhost:3003 | built-in login |
| Developer Portal | http://localhost:3004 | built-in login |
| Control Plane API | http://localhost:4001 | session token (or master key for service calls) |
| APISIX proxy | http://localhost:9080 | per route |
| APISIX admin API | http://localhost:9180 | X-API-KEY (APISIX_ADMIN_KEY) |
| AI gateway (direct) | http://localhost:4000 | bypasses L1 |
| Agent gateway (direct) | http://localhost:5001 | bypasses L1 |
| ClickHouse HTTP | http://localhost:8123 | none locally |
| Grafana / Prometheus / Jaeger | :3002 / :9090 / :16686 | observability profile |
| Zitadel console | http://localhost:8085 | sso 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 confirmationTroubleshooting
make up stops at "the stack did not become healthy"
Run docker compose ps -a. The usual causes:
migrateexited non-zero:docker compose logs migratenames the failing migration or a ClickHouse auth refusal (a non-emptyCLICKHOUSE_PASSWORD).control-plane-apirestarting:docker compose logs control-plane-api. OutsideGATEZ_ENV=localit refuses to start withoutSTS_ED25519_PRIVATE_DER_B64; locally an invalidGATEZ_ADMIN_EMAIL/GATEZ_ADMIN_PASSWORDbefore 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 upNext steps
- Introduction — architecture and design principles
- Environment variables
- Authentication — built-in sessions, portal runtime config, federation
- Architecture overview
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.comIt 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.