How to Configure the OpenClaw Gateway?
The Gateway is the heart of OpenClaw — the central process that routes messages between messengers, AI models, and skills. Proper configuration ensures reliable 24/7 operation.
The Gateway configuration lives in ~/.openclaw/config.json. Key settings include: port (default 18789), model provider and API key, connected messengers, installed skills, and resource limits.
The Gateway token is a secret key that authenticates API requests to your Gateway. It's generated during onboarding and stored in the config. You need this token to access the Dashboard and REST API remotely. Never share your Gateway token.
Port configuration: the default port is 18789. Change it if it conflicts with other services. If you're behind a firewall, make sure the port is accessible for webhook-based messenger integrations.
Resource limits: Configure max concurrent requests, token budget per request, and memory limits. These prevent runaway costs and resource exhaustion.
For production, enable structured logging (JSON format) for easier monitoring. Set up log rotation to prevent disk fills. Configure the heartbeat interval (default 30s) for daemon monitoring.
The Gateway supports hot reload — most config changes take effect without restart. For changes that require restart (port, provider), use the restart command.
# View current config openclaw config show # Set Gateway port openclaw config set port 18789 # Restart Gateway openclaw gateway restart # View Gateway logs openclaw gateway logs --follow