All posts
OpenClaw Config Reference: Every openclaw.json Setting Explained

OpenClaw Config Reference: Every openclaw.json Setting Explained

|4 min read

Every OpenClaw setting in one place. Use this as a reference when configuring your openclaw.json or running openclaw config set commands.

Where Is the Config File?

openclaw config path

Default location: ~/.openclaw/openclaw.json

In Docker containers: /app/data/openclaw.json

Gateway Settings

The gateway is OpenClaw's core process that handles connections from all clients (browser, Telegram, API).

gateway.mode

Required. Controls how the gateway accepts connections.

openclaw config set gateway.mode "local"
Value Description
local Only localhost connections (recommended for most users)
remote Accepts connections from any IP
hybrid Both local and remote connections

Without this setting, the gateway will refuse to start with gateway start blocked.

gateway.host

The hostname or IP the gateway binds to.

openclaw config set gateway.host "localhost"

Default: localhost. Set to 0.0.0.0 if you need the gateway accessible from other machines.

gateway.port

The port the gateway listens on.

openclaw config set gateway.port 3001

Default: 3001. Change this if you have a port conflict.

gateway.token

A fixed token for gateway authentication. Prevents token regeneration on restart.

openclaw config set gateway.token "your-stable-token"

If not set, OpenClaw generates a new token on every restart — which invalidates all connected devices.

Alternative: Set via environment variable OPENCLAW_GATEWAY_TOKEN.

gateway.trustedProxies

IP addresses of reverse proxies that OpenClaw should trust for forwarded headers.

openclaw config set gateway.trustedProxies '["127.0.0.1"]'

Required when using a reverse proxy (Caddy, Nginx, Traefik). Without this, OpenClaw can't verify that connections actually come from localhost when they're forwarded through the proxy.

gateway.bind

The network interface to bind to.

openclaw config set gateway.bind "127.0.0.1"

Default: 127.0.0.1 (loopback only). Set to 0.0.0.0 for external access.

AI Provider Settings

ai.model

The AI model to use for responses.

openclaw config set ai.model "claude-sonnet-4-6"

Common values: claude-sonnet-4-6, claude-opus-4-6, claude-haiku-4-5, gpt-4o, deepseek-chat.

ai.apiKey

Your AI provider's API key.

openclaw config set ai.apiKey "sk-ant-..."

Alternative: Set via environment variable ANTHROPIC_API_KEY or OPENAI_API_KEY.

ai.provider

Which AI provider to use.

openclaw config set ai.provider "anthropic"

Values: anthropic, openai, deepseek, ollama.

ai.maxTokens

Maximum tokens per response.

openclaw config set ai.maxTokens 4096

Higher values allow longer responses but cost more.

Telegram Settings

telegram.token

Your Telegram bot token from BotFather.

openclaw config set telegram.token "123456:ABC-DEF..."

telegram.allowedUsers

List of Telegram user IDs allowed to interact with the bot.

openclaw config set telegram.allowedUsers '[12345678]'

If not set, anyone who finds your bot can use it.

MCP Server Settings

mcpServers

Configuration for Model Context Protocol servers (plugins).

# GitHub integration
openclaw config set mcpServers.github.env.GITHUB_TOKEN "ghp_..."

# Google integration
openclaw config set mcpServers.google.env.CLIENT_ID "..."

Each MCP server has its own sub-configuration under mcpServers.<name>.

Memory Settings

memory.enabled

Enable or disable persistent memory.

openclaw config set memory.enabled true

memory.provider

Which memory backend to use.

openclaw config set memory.provider "supermemory"

Values: built-in, supermemory.

Tools & Permissions

tools.elevated

Enable elevated tool access (file system, shell commands).

openclaw config set tools.elevated true

tools.browser

Enable browser automation capabilities.

openclaw config set tools.browser true

Config Management Commands

# View all settings
openclaw config list

# Get a specific setting
openclaw config get gateway.mode

# Set a value
openclaw config set gateway.mode "local"

# Remove a setting
openclaw config unset gateway.token

# Validate the entire config
openclaw config validate

# Reset to defaults
openclaw config reset

# Show config file path
openclaw config path

Environment Variable Overrides

Some settings can be set via environment variables, which take precedence over openclaw.json:

Environment Variable Config Key
OPENCLAW_GATEWAY_TOKEN gateway.token
ANTHROPIC_API_KEY ai.apiKey (Anthropic)
OPENAI_API_KEY ai.apiKey (OpenAI)

Common Config Patterns

Minimal Setup

{
  "ai": {
    "model": "claude-sonnet-4-6",
    "apiKey": "sk-ant-..."
  },
  "gateway": {
    "mode": "local"
  }
}

With Telegram

{
  "ai": {
    "model": "claude-sonnet-4-6",
    "apiKey": "sk-ant-..."
  },
  "gateway": {
    "mode": "local",
    "token": "fixed-token-here"
  },
  "telegram": {
    "token": "123456:ABC-DEF...",
    "allowedUsers": [12345678]
  }
}

Behind a Reverse Proxy

{
  "ai": {
    "model": "claude-sonnet-4-6",
    "apiKey": "sk-ant-..."
  },
  "gateway": {
    "mode": "local",
    "token": "fixed-token-here",
    "trustedProxies": ["127.0.0.1"]
  }
}

Validate After Changes

Always validate after editing:

openclaw config validate

Or let doctor catch issues:

openclaw doctor

Zero Config Setup

ClawTank pre-configures all these settings for you. No openclaw.json editing needed — deploy, connect Telegram, and start using your AI agent.

Ready to deploy OpenClaw?

No Docker, no SSH, no DevOps. Deploy in under 1 minute.

Get started free