首页 关于我们 功能特性 安装指南 Skills扩展 应用场景 社区 博客 联系我们

📋 系统要求

🟢

Node.js

推荐 Node 24
最低支持 Node 22.14+

🍎

操作系统

macOS / Windows (WSL2) / Linux

🔑

API 密钥

需要准备 AI 提供商的 API Key

⏱️

预计时间

约 5 分钟完成安装和配置

🚀 安装方式

选择最适合你的安装方式

推荐

方式一:npm 安装(最简单)

适用于大多数用户,推荐优先使用这种方式安装。

macOS / Linux
# 安装 OpenClaw
npm install -g openclaw@latest

# 运行新手引导
openclaw onboard --install-daemon

# 启动控制台
openclaw dashboard
Windows (PowerShell)
# 使用 PowerShell 安装
iwr -useb https://openclaw.ai/install.ps1 | iex

# 或使用 npm
npm install -g openclaw@latest
openclaw onboard --install-daemon
openclaw dashboard
备选

方式二:Docker 安装

适用于熟悉 Docker 的用户,隔离性好,易于管理。

Docker 命令
# 拉取镜像
docker pull openclaw/openclaw:latest

# 运行容器
docker run -d \
  --name openclaw \
  -p 18789:18789 \
  -v ~/.openclaw:/root/.openclaw \
  openclaw/openclaw:latest

# 查看日志
docker logs -f openclaw
docker-compose.yml
version: '3.8'
services:
  openclaw:
    image: openclaw/openclaw:latest
    container_name: openclaw
    ports:
      - "18789:18789"
    volumes:
      - ~/.openclaw:/root/.openclaw
    restart: unless-stopped
macOS

方式三:Homebrew 安装(macOS)

macOS 用户可以使用 Homebrew 一键安装。

终端命令
# 添加 Homebrew 源(如果有的话)
brew tap openclaw/tap

# 安装 OpenClaw
brew install openclaw

# 运行新手引导
openclaw onboard --install-daemon
进阶

方式四:源码安装

适用于开发者,想要最新功能或自定义修改。

Git 克隆
# 克隆仓库
git clone https://github.com/openclaw/openclaw.git
cd openclaw

# 安装依赖
npm install

# 链接全局
npm link

# 运行
openclaw onboard --install-daemon

✨ 新手引导配置

运行 openclaw onboard 后,向导会引导你完成以下配置:

1

选择模型提供商

Claude / OpenAI / DeepSeek / Google / 本地模型 等

2

输入 API 密钥

粘贴你从对应平台获取的 API Key

3

配置 Gateway 端口

默认 18789,可自定义

4

选择渠道(可选)

Telegram / 飞书 / Discord 等

✅ 验证安装

# 检查 Gateway 状态
openclaw gateway status

# 预期输出
✅ Gateway 正在运行: http://127.0.0.1:18789

# 启动控制台
openclaw dashboard

# 预期:浏览器自动打开控制台界面

📱 配置聊天渠道

以下是常用渠道的配置示例:

# 1. 创建 Telegram Bot
# 在 Telegram 搜索 @BotFather,发送 /newbot
# 获取 Bot Token

# 2. 配置 openclaw.json
{
  "channels": {
    "telegram": {
      "enabled": true,
      "botToken": "你的Bot_Token",
      "allowFrom": ["你的用户ID"]
    }
  }
}

# 3. 重启 Gateway
openclaw gateway restart

❓ 常见问题

Q: 安装失败,提示权限错误?

A: 使用 sudo npm install -g openclaw@latest 或以管理员身份运行终端。

Q: Windows 用户推荐使用什么?

A: 推荐使用 WSL2 (Windows Subsystem for Linux) 或 Docker,可以获得更好的兼容性。

Q: 如何更新 OpenClaw?

A: 运行 npm update -g openclaw@latest 即可更新到最新版本。

Q: API Key 在哪里获取?

A: 根据你选择的模型提供商,前往对应平台申请:Anthropic、OpenAI、DeepSeek 等。

Q: 如何卸载 OpenClaw?

A: 运行 npm uninstall -g openclaw 即可卸载。