Why add another gateway?
- Run agents on a more powerful machine (e.g., a cloud VPS) while keeping the UI on a laptop
- Split agents across hosts by role (e.g., research agents on one server, writing agents on another)
- Keep a development gateway separate from your production one
- Add a gateway in a different region for latency-sensitive work
UI-driven flow (recommended)
Fill in the details
- Label — a friendly name for this gateway (e.g. “Home Mac mini”, “Hetzner VPS”)
- Tailscale auth key (optional) — if you want this gateway’s host to join your tailnet automatically, paste a Tailscale auth key here. Leave blank to configure Tailscale separately.
Copy the installer command
HQ mints a single-use registration token and generates a Click Copy.
curl | bash installer command pre-loaded with your Supabase credentials and the token. The command looks like:Run the command on the new host
SSH into the new machine and paste the command. The installer (
install.yourhq.ai/gateway) checks for Docker, writes .env, pulls the gateway images, and starts the stack. The gateway registers itself in your Supabase project using the token.Manual registration
Use this for development setups, unusual deployment layouts, or if you want full control over the configuration.Configure .env
Edit Leave
.env and set these values:GATEWAY_TOKEN unset — manual registration skips the token exchange.Start the gateway services
gateways table in Supabase and starts heartbeating every 30 seconds.Verify in the UI
Go to Settings → Gateways. The new gateway should appear with a green heartbeat. If it shows “Stale” or doesn’t appear, check:
SUPABASE_URLandSUPABASE_SERVICE_ROLE_KEYare correct- Migrations are complete (all 25 files in
db/migrations/have been run) - The host can reach Supabase:
curl $SUPABASE_URL/rest/v1/from inside the container - Gateway logs:
docker compose logs gateway | tail -50
Assigning agents to a specific gateway
When you create a new agent, HQ asks which gateway it should run on. The agent’sgateway_id is set at creation time. To move an agent to a different gateway, delete and recreate it — agents are provisioned into a specific gateway’s file system and can’t be migrated live.
Troubleshooting
Gateway appears but shows “Stale” heartbeat: The runner daemon has likely stopped. Check:docker compose logs -f runner | tail -50. Restart: docker compose restart runner.
Gateway registered but agents won’t provision:
The dispatcher or runner may not be running. Check all services: docker compose ps. If any show Restarting, tail their logs.
Token expired before you ran the command:
Close the Add Gateway dialog and open it again — this generates a fresh token with a new 15-minute window.
See also Operations →, Gateway boot sequence →
