【搭建OpenClaw】
作者:互联网
2026-04-17
一、安装Node.js(必须≥22.x)
OpenClaw要求Node.js版本≥22.x,Ubuntu默认源版本较低,需手动安装:
方法
# 验证版本
node -v # 应显示v22.x.x[11](@ref)
二、安装OpenClaw的方式
方式一:npm/pnpm全局安装
# npm安装
npm install -g openclaw@latest
# 或使用pnpm(性能更优)
npm install -g pnpm
pnpm add -g openclaw@latest[5,9,10](@ref)
方式二:Docker部署(适合服务器/生产环境)
# 安装Docker
curl -fsSL | bash
sudo systemctl start docker
sudo systemctl enable docker
# 一键Docker部署
curl -fsSL | bash[5](@ref)
三、初始化配置
安装完成后,运行初始化向导完成基础配置:
openclaw onboard --install-daemon[9,11](@ref)
配置向导会引导完成以下步骤:
- 安全确认:输入Y确认授权
- 选择模式:推荐QuickStart(快速启动)
- 配置AI模型:选择模型提供商并输入API Key
- 设置渠道:可先跳过(后续再配置)
- 技能配置:选择Yes启用基础技能
四、配置文件刷新
刷新配置文件,关键是主model别忘记刷新:
"model": {
"primary": "codez/gpt-5.3-codex"
},
具体配置如下:
[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+t",
"installPath": "/root/.openclaw/extensions/ddingtalk",
"version": "1.2.0",
"installedAt": "2026-02-11T09:49:01.618Z"
},
"wecom": {
"source": "npm",
"spec": "git+t",
"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"
}
}
}
}
五、验证安装与启动
验证安装
# 查看版本
openclaw --version
# 环境自检
openclaw doctor[9](@ref)
启动服务
# 后台启动网关(推荐)
openclaw gateway start
# 前台运行(调试用)
openclaw gateway run --verbose[9,11](@ref)
访问控制台
启动后可通过浏览器访问管理控制台:
- 本地访问:
- 远程访问:需配置网关绑定到局域网
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
MCP协议设计与实现-第7章 Prompt:可复用的交互模板
04/17
MCP协议设计与实现-第14章 SSE 与 WebSocket
04/17
从零开发一个 MCP 服务器 + OpenCode Skill:让 AI 学会审查你的代码
04/17
MCP协议设计与实现-第13章 Streamable HTTP:远程流式传输
04/17
MCP协议设计与实现-第11章 Python Client 实现剖析
04/17
HelloAgent(三): Agent总是一本正经胡说八道?用这个技术让它变靠谱
04/17
MCP协议设计与实现-第12章 STDIO 传输:本地进程通信
04/17
MCP协议设计与实现-第19章 Claude Code 的 MCP 客户端:12 万行的实战
04/17
MCP协议设计与实现-第09章 TypeScript Client 实现剖析
04/17
MCP协议设计与实现-第17章 sampling
04/17
AI精选
