简介
OpenClaw 是一个开源的 AI 助手框架,支持多模型、多渠道、多节点编排。本文记录从源码安装的完整流程。
系统环境
- 系统: Ubuntu 20.04 LTS
- 内核: Linux 5.4.0-216-generic x64
- Node.js: v22.22.0
- 版本: 2026.2.22
安装步骤
1. 安装 Node.js 22
1 2 3 4 5 6
| curl -fsSL https://deb.nodesource.com/setup_22.x | bash - apt-get install -y nodejs
node --version
|
2. 安装 pnpm
3. 克隆仓库
1 2
| git clone https://github.com/openclaw/openclaw.git cd openclaw
|
4. 安装依赖
5. 构建
1 2 3 4 5 6 7 8
| pnpm ui:build
pnpm build
pnpm link --global
|
6. 初始化
1
| openclaw onboard --install-daemon
|
验证安装
1 2 3 4 5 6 7 8
| openclaw --version
openclaw gateway status
openclaw doctor
|
目录结构
| 组件 |
路径 |
| 源码 |
/root/openclaw |
| CLI |
/root/.local/bin/openclaw |
| 配置 |
~/.openclaw/openclaw.json |
| 工作目录 |
~/.openclaw/workspace |
常用命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| openclaw gateway start openclaw gateway stop openclaw gateway restart openclaw gateway status
openclaw dashboard
openclaw status
cd /root/openclaw git pull && pnpm install && pnpm build && pnpm link --global
|
常见问题
Node.js 版本不兼容
1 2 3
| curl -fsSL https://deb.nodesource.com/setup_22.x | bash - apt-get install -y nodejs
|
pnpm install 失败
1 2 3
| apt-get install -y build-essential python3 npm install -g node-gyp
|
端口占用
1 2 3 4 5
| lsof -i :18789
export OPENCLAW_GATEWAY_PORT=18790
|
下一步
安装完成后,可以配置渠道: