OpenClaw 安装教程(2026最新):完整安装步骤与环境要求
很多人在第一次接触 OpenClaw 时,最关心的问题就是:
怎么安装?需要什么环境?安装后如何检查是否正常运行?

这篇文章把官方安装流程整理成一份更容易理解的 OpenClaw 安装指南。如果你只是想快速用起来,按推荐方式安装基本 3 分钟就能完成。
一、OpenClaw 系统要求
在安装之前,先确认你的系统环境是否满足要求。
基础环境:
Node.js ≥ 22
macOS / Linux
Windows 需要通过 WSL2
可选环境:
pnpm(仅在源码安装时需要)
如果你还没有安装 Node,可以先去 Node 官网安装最新版本。
二、OpenClaw 快速安装(推荐)
官方推荐使用 自动安装脚本,它会自动:
安装 CLI
配置环境
运行新手引导
Linux / macOS 执行:
curl -fsSL https://openclaw.ai/install.sh | bash
Windows PowerShell:
iwr -useb https://openclaw.ai/install.ps1 | iex
安装完成后,如果你跳过了新手引导,可以手动执行:
openclaw onboard --install-daemon
这一步会完成基础配置。
三、OpenClaw 手动安装方法
如果你不想使用安装脚本,也可以使用 Node 直接安装。
1、npm 全局安装
npm install -g openclaw@latest
安装完成后运行:
openclaw onboard --install-daemon
如果 sharp 安装失败
部分 macOS 用户可能会遇到 sharp 编译问题,可以使用下面方式:
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest
如果看到类似提示:
sharp: Please add node-gyp to your dependencies
解决方法:
安装 node-gyp:
npm install -g node-gyp
或者继续使用上面的 SHARP_IGNORE_GLOBAL_LIBVIPS 方式跳过编译。
2、使用 pnpm 安装
如果你习惯使用 pnpm,可以这样安装:
pnpm add -g openclaw@latest
如果提示 Ignored build scripts,需要执行:
pnpm approve-builds -g
选择以下组件:
openclaw
node-llama-cpp
sharp
然后再次执行安装:
pnpm add -g openclaw@latest
最后运行:
openclaw onboard --install-daemon
四、从源码安装(开发者方式)
如果你需要修改源码或者参与开发,可以使用 Git 安装。
git clone https://github.com/openclaw/openclaw.git cd openclaw pnpm install pnpm ui:build pnpm build
然后运行:
openclaw onboard --install-daemon
如果没有全局安装,可以通过:
pnpm openclaw ...
运行 CLI。
五、安装完成后的检查
安装完成后,建议做几个简单检查。
1、运行系统检测
openclaw doctor
2、检查服务状态
openclaw status openclaw health
3、打开控制面板
openclaw dashboard
如果一切正常,你就可以开始使用 OpenClaw 了。
六、安装脚本常用参数
安装脚本支持一些可选参数。
指定安装方式
使用 npm:
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method npm
使用 Git 源码安装:
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method git
常用参数
| 参数 | 作用 |
|---|---|
| --install-method | 选择 npm 或 git 安装 |
| --git-dir | 指定源码安装目录 |
| --no-git-update | 跳过 git pull |
| --no-prompt | 禁用交互 |
| --dry-run | 只演示执行步骤 |
| --no-onboard | 跳过新手引导 |
七、常见问题:找不到 openclaw 命令
有时候安装完成后,终端提示:
command not found: openclaw
通常是 PATH 环境变量没有包含 npm 全局路径。
先执行:
npm prefix -g
然后把返回路径加入 PATH。
macOS / Linux
在 ~/.zshrc 或 ~/.bashrc 中添加:
export PATH="$(npm prefix -g)/bin:$PATH"
保存后重新打开终端即可。
总结
如果只是普通用户,其实只需要记住一句话:
直接用安装脚本即可。
curl -fsSL https://openclaw.ai/install.sh | bash
安装完成后执行:
openclaw onboard --install-daemon
基本就能完成整个部署。
如果你是开发者,可以选择 npm 或源码安装。