Most setups should use one Gateway because a single Gateway can handle multiple messaging connections and agents. If you need stronger isolation or redundancy (e.g., a rescue bot), run separate Gateways with isolated profiles/ports.
CODERCLAW_CONFIG_PATH — per-instance config fileCODERCLAW_STATE_DIR — per-instance sessions, creds, cachesagents.defaults.workspace — per-instance workspace rootgateway.port (or --port) — unique per instanceIf these are shared, you will hit config races and port conflicts.
--profile)Profiles auto-scope CODERCLAW_STATE_DIR + CODERCLAW_CONFIG_PATH and suffix service names.
# main
coderclaw --profile main setup
coderclaw --profile main gateway --port 18789
# rescue
coderclaw --profile rescue setup
coderclaw --profile rescue gateway --port 19001
Per-profile services:
coderclaw --profile main gateway install
coderclaw --profile rescue gateway install
Run a second Gateway on the same host with its own:
This keeps the rescue bot isolated from the main bot so it can debug or apply config changes if the primary bot is down.
Port spacing: leave at least 20 ports between base ports so the derived browser/canvas/CDP ports never collide.
# Main bot (existing or fresh, without --profile param)
# Runs on port 18789 + Chrome CDC/Canvas/... Ports
coderclaw onboard
coderclaw gateway install
# Rescue bot (isolated profile + ports)
coderclaw --profile rescue onboard
# Notes:
# - workspace name will be postfixed with -rescue per default
# - Port should be at least 18789 + 20 Ports,
# better choose completely different base port, like 19789,
# - rest of the onboarding is the same as normal
# To install the service (if not happened automatically during onboarding)
coderclaw --profile rescue gateway install
Base port = gateway.port (or CODERCLAW_GATEWAY_PORT / --port).
gateway.port)browser.controlPort + 9 .. + 108If you override any of these in config or env, you must keep them unique per instance.
browser.cdpUrl to the same values on multiple instances.browser.profiles.<name>.cdpPort per instance.browser.profiles.<name>.cdpUrl (per profile, per instance).CODERCLAW_CONFIG_PATH=~/.coderclaw/main.json \
CODERCLAW_STATE_DIR=~/.coderclaw-main \
coderclaw gateway --port 18789
CODERCLAW_CONFIG_PATH=~/.coderclaw/rescue.json \
CODERCLAW_STATE_DIR=~/.coderclaw-rescue \
coderclaw gateway --port 19001
coderclaw --profile main status
coderclaw --profile rescue status
coderclaw --profile rescue browser status