一、安装Node.js(必须≥22.x)
OpenClaw要求Node.js版本≥22.x,Ubuntu默认源版本较低,需手动安装:
方法
less
# 验证版本
node -v # 应显示v22.x.x[11](@ref)
二、安装OpenClaw的方式
方式一:npm/pnpm全局安装
less
# npm安装
npm install -g openclaw@latest
# 或使用pnpm(性能更优)
npm install -g pnpm
pnpm add -g openclaw@latest[5,9,10](@ref)
方式二:Docker部署(适合服务器/生产环境)
bash
# 安装Docker
curl -fsSL https://get.docker.com | bash
sudo systemctl start docker
sudo systemctl enable docker
# 一键Docker部署
curl -fsSL https://cdn.jsdelivr.net/gh/1186258278/OpenClawChineseTranslation@main/docker-deploy.sh | bash[5](@ref)
三、初始化配置
安装完成后,运行初始化向导完成基础配置:
less
openclaw onboard --install-daemon[9,11](@ref)
配置向导会引导完成以下步骤:
- 安全确认:输入Y确认授权
- 选择模式:推荐QuickStart(快速启动)
- 配置AI模型:选择模型提供商并输入API Key
- 设置渠道:可先跳过(后续再配置)
- 技能配置:选择Yes启用基础技能
四、配置文件刷新
刷新配置文件,关键是主model别忘记刷新:
json
"model": {
"primary": "codez/gpt-5.3-codex"
},
具体配置如下:
csharp
[root@OS .openclaw]# more openclaw.json
{
"meta": {
"lastTouchedVersion": "2026.2.9",
"lastTouchedAt": "2026-02-19T00:37:21.820Z"
},
"wizard": {
"lastRunAt": "2026-02-19T00:34:13.156Z",
"lastRunVersion": "2026.2.9",
"lastRunCommand": "onboard",
"lastRunMode": "local"
},
"models": {
"mode": "merge",
"providers": {
"codez": {
"baseUrl": "你的URL",
"apiKey": "你的key",
"api": "openai-completions",
"models": [
{
"id": "gpt-5.3-codex",
"name": "gpt-5.3-codex",
"reasoning": false,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 200000,
"maxTokens": 8192,
"compat": {
"supportsStore": false
}
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "codez/gpt-5.3-codex"
},
"workspace": "/root/.openclaw/workspace",
"compaction": {
"mode": "safeguard"
},
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
}
}
},
"messages": {
"ackReactionScope": "group-mentions"
},
"commands": {
"native": "auto",
"nativeSkills": "auto"
},
"channels": {
"feishu": {
"enabled": true,
"appId": "cli_a9xxxxxxxx",
"appSecret": "5fZvLoxxxxxxxxx",
"domain": "feishu",
"groupPolicy": "open"
},
"timbot": {
"enabled": true,
"webhookPath": "/timbot",
"sdkAppId": "1600xxxxx",
"botAccount": "@RBxxxxx",
"token": "xiaxxxxxxx",
"secretKey": "2b489exxxxxxxxxxxxxxxxxxxxxxxx",
"dm": {
"policy": "open"
}
}
},
"gateway": {
"port": 18789,
"mode": "local",
"bind": "lan",
"controlUi": {
"allowInsecureAuth": false
},
"auth": {
"mode": "token",
"token": "61c689d8bda509xxxxxxxxxxxx5"
},
"tailscale": {
"mode": "off",
"resetOnExit": false
}
},
"skills": {
"install": {
"nodeManager": "npm"
}
},
"plugins": {
"entries": {
"feishu": {
"enabled": true
},
"qqbot": {
"enabled": true
},
"ddingtalk": {
"enabled": true
},
"wecom": {
"enabled": true
},
"adp-openclaw": {
"enabled": true
},
"timbot": {
"enabled": true
}
},
"installs": {
"qqbot": {
"source": "npm",
"spec": "@sliverp/qqbot@latest",
"installPath": "/root/.openclaw/extensions/qqbot",
"version": "1.4.4",
"installedAt": "2026-02-11T09:48:41.090Z"
},
"ddingtalk": {
"source": "npm",
"spec": "git+https://cnb.cool/lighthouse/lighthousebackend/openclaw-dingtalk.git",
"installPath": "/root/.openclaw/extensions/ddingtalk",
"version": "1.2.0",
"installedAt": "2026-02-11T09:49:01.618Z"
},
"wecom": {
"source": "npm",
"spec": "git+https://cnb.cool/lighthouse/lighthousebackend/openclaw-wecom.git",
"installPath": "/root/.openclaw/extensions/wecom",
"version": "2026.2.5",
"installedAt": "2026-02-11T09:49:25.555Z"
},
"adp-openclaw": {
"source": "npm",
"spec": "adp-openclaw",
"installPath": "/root/.openclaw/extensions/adp-openclaw",
"version": "0.0.24",
"installedAt": "2026-02-11T09:49:33.241Z"
},
"timbot": {
"source": "npm",
"spec": "timbot",
"installPath": "/root/.openclaw/extensions/timbot",
"version": "2026.2.11",
"installedAt": "2026-02-19T00:13:48.063Z"
}
}
}
}
五、验证安装与启动
验证安装
less
# 查看版本
openclaw --version
# 环境自检
openclaw doctor[9](@ref)
启动服务
less
# 后台启动网关(推荐)
openclaw gateway start
# 前台运行(调试用)
openclaw gateway run --verbose[9,11](@ref)
访问控制台
启动后可通过浏览器访问管理控制台:
- 本地访问 :http://localhost:18789
- 远程访问:需配置网关绑定到局域网