安装
- Node 24(推荐)或 Node 22.19+ - 安装程序脚本会自动处理此要求
- macOS、Linux 或 Windows - 原生 Windows 和 WSL2 均受支持;WSL2 更加稳定。请参阅 Windows。
pnpm仅在从源码构建时需要
推荐:安装程序脚本
Section titled “推荐:安装程序脚本”最快的安装方式。它会检测您的操作系统,按需安装 Node,安装 OpenClaw,并启动新手引导。
bash curl -fsSL https://openclaw.ai/install.sh | bash
powershell iwr -useb https://openclaw.ai/install.ps1 | iex
要在不运行新手引导的情况下安装:
bash curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
powershell & ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard
有关所有标志和 CI/自动化选项,请参阅 安装程序内部机制。
替代安装方法
Section titled “替代安装方法”本地前缀安装程序 (install-cli.sh)
Section titled “本地前缀安装程序 (install-cli.sh)”当您希望将 OpenClaw 和 Node 保留在本地前缀(例如
OpenClaw~/.openclaw)下,而不依赖系统范围的 Node 安装时,请使用此方法:
curl -fsSL https://openclaw.ai/install-cli.sh | bash默认情况下,它支持通过 npm 安装,并在相同的前缀流程下支持 git-checkout 安装。完整参考:安装程序内部机制。
已经安装?使用 openclaw update --channel dev 和 openclaw update --channel stable 在软件包和 git 安装之间切换。请参阅 更新。
npm、pnpm 或 bun
Section titled “npm、pnpm 或 bun”如果您已经自己管理 Node:
npm install -g openclaw@latestopenclaw onboard --install-daemonpnpm add -g openclaw@latestpnpm approve-builds -gopenclaw onboard --install-daemonbun add -g openclaw@latestopenclaw onboard --install-daemon故障排除:sharp 构建错误 (npm)
如果 sharp 因全局安装的 libvips 而失败:
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest针对贡献者或任何想要从本地检出运行的人:
git clone https://github.com/openclaw/openclaw.gitcd openclawpnpm install && pnpm build && pnpm ui:buildpnpm link --globalopenclaw onboard --install-daemon或者跳过链接并从仓库内部使用 pnpm openclaw ...。有关完整的开发工作流,请参阅 设置。
从 GitHub main 安装
Section titled “从 GitHub main 安装”npm install -g github:openclaw/openclaw#main容器和包管理器
Section titled “容器和包管理器”容器化或无头部署。
Docker 的无根容器替代方案。
通过 Nix flake 进行声明式安装。
自动化集群配置。
通过 Bun 运行时仅使用 CLI。
openclaw --version # confirm the CLI is availableopenclaw doctor # check for config issuesopenclaw gateway status # verify the Gateway is running如果您需要在安装后进行托管启动:
- macOS:通过
openclaw onboard --install-daemon或openclaw gateway install使用 LaunchAgent - Linux/WSL2:通过相同的命令使用 systemd 用户服务
- 原生 Windows:优先使用计划任务,如果拒绝创建任务,则回退到每用户启动文件夹登录项
在云服务器或 VPS 上部署 OpenClaw:
任何 Linux VPS
共享 Docker 步骤
K8s
Fly.io
Hetzner
Google Cloud
Azure
Railway
Render
Northflank
更新、迁移或卸载
Section titled “更新、迁移或卸载”保持 OpenClaw 为最新版本。
迁移到新机器。
完全移除 OpenClaw。
故障排除:找不到 openclaw
Section titled “故障排除:找不到 openclaw”如果安装成功但在终端中找不到 openclaw:
node -v # Node installed?npm prefix -g # Where are global packages?echo "$PATH" # Is the global bin dir in PATH?如果 $(npm prefix -g)/bin 不在您的 $PATH 中,请将其添加到您的 Shell 启动文件(~/.zshrc 或 ~/.bashrc)中:
export PATH="$(npm prefix -g)/bin:$PATH"然后打开一个新的终端。有关更多详细信息,请参阅 Node setup。