安装部署
OpenClaw 支持多种安装方式,选择适合你的场景。
方式一:NPM 安装(推荐个人使用)
bash
# 安装
npm install -g openclaw@latest
# 引导配置 + 安装守护进程
openclaw onboard --install-daemon方式二:一键脚本
bash
curl -fsSL https://openclaw.ai/install.sh | bashpowershell
iwr -useb https://openclaw.ai/install.ps1 | iex方式三:Docker(生产环境推荐)
bash
git clone https://github.com/openclaw/openclaw.git
cd openclaw
./docker-setup.sh或使用预构建镜像:
bash
docker pull ghcr.io/openclaw/openclaw:latest详细 Docker 配置参见 Docker 部署指南。
方式四:从源码构建
bash
git clone https://github.com/openclaw/openclaw.git
cd openclaw
pnpm install
pnpm ui:build
pnpm build
pnpm openclaw onboard --install-daemon系统架构
消息平台 (Telegram/WhatsApp/...)
↓
Gateway (ws://127.0.0.1:18789) ← 控制面板 / CLI
↓
Pi Agent (RPC) → AI 模型 API
↓
工具执行 (终端 / 文件 / 浏览器)关键端口:
| 端口 | 用途 |
|---|---|
| 18789 | Gateway + Dashboard |
| 18790 | Bridge |
| 18792 | Browser CDP Relay |
| 18793 | Canvas Host |
更新
bash
# 稳定版
openclaw update --channel stable
# 测试版(尝鲜)
openclaw update --channel beta常用 CLI 命令
bash
openclaw doctor # 健康检查
openclaw gateway status # 网关状态
openclaw dashboard # 打开控制面板
openclaw channels login # 登录消息平台
openclaw channels list # 列出已连接平台
openclaw models list # 列出可用模型
openclaw models set <model> # 设置主模型