OpenClaw Configuration Guide
Overview
OpenClaw is a model-agnostic, self-hosted AI agent platform. Its behavior is controlled by a single main configuration file (and optional environment variables) that define the gateway, channel adapters (WhatsApp, Telegram, Discord, Slack, and 15+ more), model providers (Anthropic Claude, OpenAI, Google Gemini, DeepSeek, or local models via Ollama), agents (personalities, system prompts, skills), memory, and advanced settings. Understanding and editing this configuration lets you tailor your AI agent to your use cases while following security best practices.
This section covers:
- Configuration file structure - where config lives and how it is organized
- Model provider setup - Claude, GPT, Gemini, DeepSeek, Ollama
- Memory system - persistent context and cross-session storage
- Agent customization - multiple agents, system prompts, skills
- Advanced settings - tuning and expert options
- Quick reference - commands and next steps
Configuration File Guide
OpenClaw uses a single main config file (typically YAML or JSON) and a predictable directory layout for config, session data, logs, and installed skills. Knowing where files live and how sections are structured helps you edit safely, back up correctly, and troubleshoot with openclaw doctor and openclaw status.
Model Provider Setup
OpenClaw works with any LLM backend: Anthropic Claude, OpenAI GPT, Google Gemini, DeepSeek, and local models (e.g. via Ollama or LM Studio). You configure API keys (or local endpoints) and choose which model each agent uses. This keeps your data on your infrastructure when using local models, or lets you mix cloud and local for cost and privacy.
Memory System
OpenClaw’s memory system provides persistent context across all sessions and messaging platforms. You can configure how much context is stored, where it is saved, and how it is used so your agent remembers past conversations and tasks.
Agent Customization
You can run a single default agent or define multiple agents with different personalities, system prompts, models, and ClawHub skills. Each agent can be tied to specific channels or use cases-for example, a “support” agent for customer queries and a “personal” agent for productivity.
Advanced Settings
Advanced configuration covers performance tuning, logging, sandbox and tool restrictions, and other options for power users and production deployments. Use these after you have the basics in place.
Quick Reference
Common configuration-related commands:
openclaw config edit- open the main config file in your default editoropenclaw status- show gateway and channel statusopenclaw doctor- run diagnostics (paths, config, connectivity)openclaw doctor --fix- attempt automatic fixes where supported
For credential and API key management, use environment variables or a secrets manager and follow the credential management and security best practices guides. If something breaks after a config change, see the troubleshooting guide and configuration problems section.
Prerequisites
- OpenClaw installed and running (Quick Start)
- Basic familiarity with the command line and editing YAML/JSON
- API keys or local model endpoints for the model providers you plan to use
Next Steps
- Set up your first channel (e.g. Telegram, WhatsApp, Discord)
- Harden your installation using the security best practices and security checklist
- Explore use cases and install skills from ClawHub
- Bookmark the troubleshooting hub for config validation and gateway issues