Skip to content

安装部署

OpenClaw 支持多种安装方式,选择适合你的场景。

方式一:NPM 安装(推荐个人使用)

bash
# 安装
npm install -g openclaw@latest

# 引导配置 + 安装守护进程
openclaw onboard --install-daemon

方式二:一键脚本

bash
curl -fsSL https://openclaw.ai/install.sh | bash
powershell
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

工具执行 (终端 / 文件 / 浏览器)

关键端口:

端口用途
18789Gateway + Dashboard
18790Bridge
18792Browser CDP Relay
18793Canvas 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>  # 设置主模型

OpenClaw 中文教程 - 社区项目