#connect 5 gateways together
1 messages ยท Page 1 of 1 (latest)
Based on the docs, here's the deal with multiple gateways:
What you probably need to know
One gateway can handle everything. A single Clawdbot gateway runs multiple channels (WhatsApp, Discord, etc.), multiple agents, and all their sessions. You don't need 5 gateways for 5 channels.
When you'd actually use multiple gateways
Multiple gateways are for isolation, not scaling:
- Rescue bot โ keep a second gateway isolated so you can debug if the main one crashes
- Multi-tenant โ different users on the same host with completely separate data
- Different configs โ e.g., one for dev, one for prod
Quick setup for 5 isolated gateways
Use --profile to isolate each one:
# Gateway 1 (main)
clawdbot --profile gw1 onboard
clawdbot --profile gw1 gateway --port 18789
# Gateway 2
clawdbot --profile gw2 onboard
clawdbot --profile gw2 gateway --port 18789+20=18809
# ... repeat for gw3-gw5 with +20 ports each
Key isolation settings per profile:
CLAWDBOT_STATE_DIR(auto-scoped with--profile)gateway.port(must be unique)agents.defaults.workspacebridge.port,canvasHost.port(derived: base+1, base+4)
If you meant something else
If you're trying to connect gateways across different machines (not just multiple on one host), that's not a built-in clustering feature. Each machine would run its own gateway, and you'd manage them separately.
Could you clarify what you're trying to accomplish? That'll help me point you to the right solution! ๐ฆ
i have already 5 separate gateways running on one host, all working, they are just not aware of each other. is there are way to connect them, so agents can send messages between them?
Based on the docs, there's no built-in federation feature for gateways to talk to each other. The Gateway protocol is for clients โ gateway, not gateway โ gateway.
Current architecture
- Each gateway is an island (sessions, agents, channels are isolated)
- No native cross-gateway messaging or RPC
Workarounds if you need inter-gateway communication
Option 1: Use a shared message bus
If gateways are on the same host, they could:
- Listen on a shared Redis pub/sub or NATS channel
- An agent on gateway A sends to the bus, agent on gateway B subscribes and relays
Option 2: HTTP webhooks
- One gateway's agent calls
curlto another gateway's HTTP endpoint (if you expose it) - Requires auth tokens and some glue code