Runoob Tutorial ArchiveEnglish

OpenClaw configuration directory

OpenClaw configuration directory

All configurations, state data, workspaces, and skills for OpenClaw (also known as Clawdbot) are centralized in the core directory ~/.openclaw/ (Linux/macOS) or %USERPROFILE%.openclaw\ (Windows) under the user's home directory.

~/.openclaw/ is the root configuration directory for the entire system and is automatically created when openclaw onboard or openclaw onboard --install-daemon is installed/run for the first time.

Original prompt (Chinese, left untranslated)

~/.openclaw/

├── openclaw.json                 # 主配置文件(JSON/JSON5)

├── workspace/                    # 你的 AI “灵魂”文件夹(推荐 git 版本控制)

│   ├── SOUL.md                   # 人格设定(语气、风格)

│   ├── USER.md                   # 你的个人信息(让 AI 更懂你)

│   ├── MEMORY.md                 # 长期记忆(手动可编辑)

│   ├── IDENTITY.md               # Agent 名称、形象

│   ├── AGENTS.md                 # 多 Agent 路由规则

│   ├── BOOT.md                   # 启动提示词

│   ├── HEARTBEAT.md              # 每日检查清单

│   └── skills/                   # 已安装技能(每个技能一个子文件夹)

├── agents/<cid>/                 # 每个 Agent 的独立状态

├── memory/<cid>.sqlite           # 向量记忆库

├── credentials/                  # API Key、OAuth(旧版)

├── skills/                       # 全局技能包

└── secrets.json                  # 加密凭证(可选)

openclaw setup runoob

Most important files:

View/modify configuration command:

Original prompt (Chinese, left untranslated)



openclaw configure      # 交互式配置向导

openclaw config file          # 显示完整路径

openclaw config get agent.model

openclaw config set agent.model "anthropic/claude-3-5-sonnet"

openclaw config validate      # 校验合法性

Path Description of use
~/.openclaw/openclaw.json Main configuration file(Most important!)

Original prompt (Chinese, left untranslated)

 存储全局设置(模型、Gateway 模式、绑定地址、Agents 默认值、插件等)。       

 Available commands to view/modify:

 • `openclaw config file`(显示完整路径)       

 • `openclaw config get <json路径>`       

 • `openclaw config set <json路径> <值>` |

|~/.openclaw/workspace/|Default Workspace(The location of the Agent's "soul")
Stores the following Markdown files (editable for immediate effect):
•SOUL.md: AI personality/tone settings
•USER.mdYour personal preferences and background
•MEMORY.mdLong-term memory records
•AGENTS.mdInstruction description
•IDENTITY.mdName/Topic
•BOOT.mdStartup Configuration
•HEARTBEAT.mdPeriodic Check List | |~/.openclaw/agents/<cid>/| Agent Status Directory (<cid>By Instance ID) | |~/.openclaw/agents/<agentId>/agent/auth-profiles.json|API Key & OAuth Credentials(Recommended location for new versions)
The old version may be in~/.openclaw/credentials/| |~/.openclaw/memory/<cid>.sqlite| Vector index storage (for memory search) | |~/.openclaw/skills/|Global skill directory
Skills throughopenclaw skills installorclawhub installinstalled skill packages are placed here (each skill is a subfolder containing SKILL.md) | |~/.openclaw/memory/| Long-term memory related files (SQLite + vector embeddings) |/tmp/openclaw/*.log| Gateway service logs (for debugging) |

1. Main configuration file

Path: ~/.openclaw/openclaw.json

Description:OpenClaw's core configuration file, containing all system-level settings.

Main configuration items:

mode: Gateway mode (e.g., "local") - port: Gateway port number (default 18789) - bind: Bind address (default 127.0.0.1) - token: Access token, used for Web UI authentication - Default model settings - API authentication information - TTS (Text-to-Speech) settings - Message format configuration

Example configuration snippet:

{

  "gateway": {

    "mode": "local",

    "port": 18789,

    "bind": "127.0.0.1",

    "token": "c9917c5a066beeb26266d09baed99495e7563b33c771e89a"

  }

}

Operational suggestions:

2. Workspace directory

Path: ~/.openclaw/workspace/

Description:The default working directory for OpenClaw, where all AI-generated files, temporary files, and user-requested output files are stored.

Main uses:

Permission description:

Usage suggestions:

3. Agent State Directory

Path: ~/.openclaw/agents/<cid>/

Description:Storage directory for the agent's state and configuration for each conversation.<cid>Is the conversation ID; each conversation has an independent configuration space.

Directory structure:

Original prompt (Chinese, left untranslated)

~/.openclaw/agents/<cid>/

├── agent/

│   ├── auth-profiles.json    # 该会话的 OAuth 和 API 密钥

│   └── ...

└── ...

auth-profiles.json Description:

Data isolation:

4. Authentication Credential Directory (Old Version)

Path: ~/.openclaw/credentials/

Description:Credential storage location of the old version of OpenClaw.

Migration instructions:

5. Memory storage directory

Path: ~/.openclaw/memory/

Description:Storage location for OpenClaw's persistent memory system, including vector indexes and conversation history.

Main files:

- Store semantic vectors of conversations - Supports semantic search function - Used for long-term memory retrieval - Markdown file named by date - Records all conversation content of the day - Convenient for manual viewing and archiving

Memory function:

Maintenance suggestions:

6. Skill Directory

Path: ~/.openclaw/skills/

Description:Installation location for globally shared Skills. Skills are plugins that extend OpenClaw functionality.

Skill Management:

Common skill examples:

Skill Ecosystem:

Configuration Instructions:

7. Gateway log directory

Path: /tmp/openclaw/*.log

Description:Runtime logs for the gateway service, stored in the system temporary directory.

Log types:

Log Management:

Gateway Service Management:

Original prompt (Chinese, left untranslated)

openclaw gateway start    # 启动网关

openclaw gateway status   # 查看状态

openclaw gateway stop     # 停止网关


Other Important Files

USER.md

Path:Usually located in the workspace or a user-defined location

Description:User information file, containing personalized information about the user to help the AI better understand user needs.

Content Example:


Configuration File Management Best Practices

1. Backup Strategy

Key Directory Backup:

Original prompt (Chinese, left untranslated)

# 备份整个配置目录

tar -czf openclaw-backup-$(date +%Y%m%d).tar.gz ~/.openclaw/



# Only backup core configurations

cp ~/.openclaw/openclaw.json ~/backups/

cp -r ~/.openclaw/memory/ ~/backups/memory/

Suggested Backup Frequency:

2. Security recommendations

Sensitive information protection:

Permission settings:

Original prompt (Chinese, left untranslated)

# 确保配置目录仅用户可访问

chmod 700 ~/.openclaw/

chmod 600 ~/.openclaw/openclaw.json

chmod 600 ~/.openclaw/agents/*/agent/auth-profiles.json

3. Migration and upgrade

Version upgrade notes:

Cross-device synchronization:

4. Troubleshooting

Diagnosing configuration issues:

Original prompt (Chinese, left untranslated)

# 检查配置文件语法

cat ~/.openclaw/openclaw.json | json_pp



# Deep check

openclaw doctor --deep



# Check gateway status

openclaw gateway status

Common issues:


Environment variable configuration

OpenClaw support can be configured via environment variables:

Original prompt (Chinese, left untranslated)

# API 密钥环境变量

export ANTHROPIC_API_KEY="your-key-here"

export OPENAI_API_KEY="your-key-here"

export DEEPSEEK_API_KEY="your-key-here"



# Custom configuration directory

export OPENCLAW_HOME="~/custom-path/.openclaw"

Environment variable priority:


Network and deployment configuration

Local deployment

Default configuration:

Access method:

http://127.0.0.1:18789/#token=<your-token>

Cloud deployment

OpenClaw supports deployment on cloud servers:

Supported platforms:

Cloud configuration features:


Platform integration configuration

OpenClaw supports multiple instant messaging platforms:

Supported platforms

Configuration location

Chat channel configurations are stored inopenclaw.json, including:

Configuration Management

Original prompt (Chinese, left untranslated)

# 添加新渠道

openclaw channels add



# List configured channels

openclaw channels list



# Pairing Management

openclaw pairing list

openclaw pairing approve <platform> <code>