Skip to content

安装OpenClaw

📋 环境要求

要求最低配置推荐配置
Node.jsNode 22 LTSNode 24
操作系统Windows/macOS/LinuxLinux服务器
内存2GB4GB+
存储1GB10GB+

🚀 Windows 安装

方式一:PowerShell(推荐)

powershell
iwr -useb https://openclaw.ai/install.ps1 | iex

方式二:手动安装

  1. 安装 Node.js 22 LTS
  2. 打开终端/命令行
  3. 执行:
bash
npm install -g openclaw@latest

🍎 macOS 安装

bash
# 安装Homebrew(如果没有)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# 安装Node.js
brew install node

# 安装OpenClaw
npm install -g openclaw@latest

🐧 Linux/Ubuntu 安装

一键安装(推荐)

bash
curl -fsSL https://openclaw.ai/install.sh | bash

手动安装

bash
# 1. 安装Node.js
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs

# 2. 安装OpenClaw
sudo npm install -g openclaw@latest

# 3. 验证安装
openclaw --version

⚙️ 初始化配置

安装完成后,运行初始化向导:

bash
openclaw onboard --install-daemon

这个命令会:

  1. ✅ 引导你配置API Key
  2. ✅ 设置Gateway参数
  3. ✅ 可选安装飞书/Telegram等渠道
  4. ✅ 安装系统服务(开机自启)

▶️ 启动Gateway

bash
# 启动服务
openclaw gateway --port 18789

# 或者使用systemd服务
openclaw gateway start

🌐 访问控制台

启动后,在浏览器打开:


❓ 常见问题

1. 安装失败怎么办?

bash
# 清理后重试
npm uninstall -g openclaw
npm cache clean --force
npm install -g openclaw@latest

2. 端口被占用?

bash
# 查看端口占用
lsof -i :18789

# 换端口
openclaw gateway --port 18889

3. 需要代理?

bash
# 设置代理
export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890

➡️ 下一步

Gateway启动成功了吗?配置你的第一个AI模型 →

Released under the MIT License.