安装概览
安装
系统要求
- Node 24(推荐)或 Node 22.16+ - 安装脚本会自动处理这一点
- macOS、Linux 或 Windows - 支持原生 Windows 和 WSL2;WSL2 更稳定。参见 Windows。
- 只有从源码构建时才需要
pnpm
推荐:安装脚本
最快的安装方式。它会检测你的 OS,在需要时安装 Node,安装 OpenClaw,并启动新手引导。
macOS / Linux / WSL2
curl -fsSL https://openclaw.ai/install.sh | bashWindows (PowerShell)
iwr -useb https://openclaw.ai/install.ps1 | iex安装但不运行新手引导:
macOS / Linux / WSL2
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboardWindows (PowerShell)
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard有关所有标志和 CI/自动化选项,请参见安装器内部机制。
替代安装方法
本地前缀安装器(install-cli.sh)
当你希望将 OpenClaw 和 Node 保存在本地前缀(例如
~/.openclaw)下,而不依赖系统范围的 Node 安装时,请使用此方法:
curl -fsSL https://openclaw.ai/install-cli.sh | bash它默认支持 npm 安装,也支持在同一个 前缀流程下进行 git-checkout 安装。完整参考:安装器内部机制。
已经安装了?使用 openclaw update --channel dev 和 openclaw update --channel stable 在 package 和 git 安装之间切换。参见
更新。
npm、pnpm 或 bun
如果你已经自行管理 Node:
npm
npm install -g openclaw@latestopenclaw onboard --install-daemonpnpm
pnpm add -g openclaw@latestpnpm approve-builds -gopenclaw onboard --install-daemonbun
bun add -g openclaw@latestopenclaw onboard --install-daemon故障排除:sharp 构建错误(npm)
如果 sharp 因全局安装的 libvips 而失败:
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest从源码安装
适用于贡献者或任何想从本地 checkout 运行的人:
git clone https://github.com/openclaw/openclaw.gitcd openclawpnpm install && pnpm build && pnpm ui:buildpnpm link --globalopenclaw onboard --install-daemon或者跳过链接,在 repo 内部使用 pnpm openclaw ...。完整开发工作流请参见设置。
从 GitHub main 安装
npm install -g github:openclaw/openclaw#main容器和 package manager
Docker
容器化或无头部署。
Podman
Docker 的无 root 容器替代方案。
Nix
通过 Nix flake 进行声明式安装。
Ansible
自动化集群预配。
Bun
通过 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:优先使用计划任务;如果任务创建被拒绝,则回退到按用户的 Startup 文件夹登录项
托管和部署
在云服务器或 VPS 上部署 OpenClaw:
VPS
Docker VM
Kubernetes
Fly.io
Hetzner
GCP
Azure
Railway
Was this useful?
Render
故障排除:找不到
bash bash
Northflank
更新、迁移或卸载
故障排除:找不到 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 设置。