安装部署
从零开始,一步步掌握 OpenClaw
⚡ 快速安装 (推荐)
Terminal
# 一键安装脚本(自动检测系统、安装 Node、配置 OpenClaw)
curl -fsSL https://openclaw.ai/install.sh | bash
📦 手动安装 (npm)
1
确认 Node.js 版本
需要 Node 24 (推荐) 或 Node 22.16+
node --version # 检查版本
2
安装 OpenClaw
npm install -g openclaw@latest
3
运行配置向导
openclaw onboard --install-daemon
向导会引导你选择模型提供商、设置 API Key、配置 Gateway。
4
验证安装
openclaw gateway status
openclaw dashboard # 打开控制面板
⚡ 快速安装 (推荐)
Terminal
# 一键安装脚本
curl -fsSL https://openclaw.ai/install.sh | bash
🍺 使用 Homebrew 安装 Node
1
安装 Homebrew (如未安装)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2
安装 Node.js
brew install node
node --version # 确认版本 >= 22.16
3
安装并配置 OpenClaw
npm install -g openclaw@latest
openclaw onboard --install-daemon
💡 macOS 服务会安装为 launchd 用户服务,登录后自动启动。
✅ WSL2 是推荐的 Windows 安装方式,提供完整的 Linux 体验和最佳兼容性。
1
安装 WSL2 + Ubuntu
以管理员身份打开 PowerShell:
wsl --install
# 或指定发行版
wsl --install -d Ubuntu-24.04
按提示重启 Windows。
2
启用 systemd (必须)
在 WSL 终端中执行:
sudo tee /etc/wsl.conf >/dev/null <<'EOF'
[boot]
systemd=true
EOF
然后在 PowerShell 中重启 WSL:
wsl --shutdown
3
在 WSL 中安装 OpenClaw
curl -fsSL https://openclaw.ai/install.sh | bash
# 或手动安装
npm install -g openclaw@latest
openclaw onboard --install-daemon
⚠️ 原生 Windows 支持正在完善中,部分功能可能有差异。推荐使用 WSL2 获得最佳体验。
1
运行设置脚本
./scripts/docker/setup.sh
脚本会自动构建镜像、运行配置向导、启动 Gateway。
2
打开控制面板
# 浏览器访问
http://127.0.0.1:18789/
# 或获取链接
docker compose run --rm openclaw-cli dashboard --no-open
🚀 使用预构建镜像
export OPENCLAW_IMAGE="ghcr.io/openclaw/openclaw:latest"
./scripts/docker/setup.sh
预构建镜像发布在 GitHub Container Registry,可用标签:main、latest、版本号。
⚙️ 常用命令
# 健康检查
curl -fsS http://127.0.0.1:18789/healthz
# 添加频道
docker compose run --rm openclaw-cli channels add --channel telegram --token ""
# 查看设备
docker compose run --rm openclaw-cli devices list
🐳 使用 Docker Compose 运行
✅ Docker 部署适合容器化环境、CI/CD 流程、快速体验 OpenClaw。
1
克隆仓库
git clone https://github.com/openclaw/openclaw.git
cd openclaw
2
运行设置脚本
./scripts/docker/setup.sh
脚本会自动构建镜像、运行配置向导、启动 Gateway。
3
打开控制面板
# 浏览器访问
http://127.0.0.1:18789/
# 或获取链接
docker compose run --rm openclaw-cli dashboard --no-open
🚀 使用预构建镜像
export OPENCLAW_IMAGE="ghcr.io/openclaw/openclaw:latest"
./scripts/docker/setup.sh
预构建镜像发布在 GitHub Container Registry,可用标签:main、latest、版本号。
⚙️ 常用命令
# 健康检查
curl -fsS http://127.0.0.1:18789/healthz
# 添加频道
docker compose run --rm openclaw-cli channels add --channel telegram --token ""
# 查看设备
docker compose run --rm openclaw-cli devices list
📱 开始使用
安装完成后,接入你喜欢的聊天平台: