跳转到内容

安装

  • Node 24(推荐)或 Node 22.19+ - 安装程序脚本会自动处理此要求
  • macOS、Linux 或 Windows - 原生 Windows 和 WSL2 均受支持;WSL2 更稳定。请参阅 Windows。
  • 仅当您从源码构建时才需要 pnpm

最快的安装方式。它会检测您的操作系统,按需安装 Node,安装 OpenClaw,并启动新手引导。

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

要在不运行新手引导的情况下安装:

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

有关所有标志和 CI/自动化选项,请参阅 安装程序内部机制。

当您希望 OpenClaw 和 Node 保存在本地前缀(例如 ~/.openclaw)下而不依赖于系统范围的 Node 安装时,请使用此方法:

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

默认情况下,它支持 npm 安装,此外还支持在同一前缀流中进行 git-checkout 安装。完整参考:安装程序内部机制。

已经安装?使用 openclaw update --channel dev 和 openclaw update --channel stable 在软件包安装和 git 安装之间切换。请参阅 更新。

如果您已经自己管理 Node:

Terminal window
npm install -g openclaw@latest
openclaw onboard --install-daemon
```npm

适用于贡献者或任何希望从本地检出运行的人:

Terminal window
git clone https://github.com/openclaw/openclaw.git
cd openclaw
pnpm install && pnpm build && pnpm ui:build
pnpm link --global
openclaw onboard --install-daemon

或者跳过链接,在仓库内部使用 pnpm openclaw ...。有关完整的开发工作流,请参阅 Setup。

Terminal window
curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --install-method git --version main
DockerDocker

容器化或无头部署。

Podman

Docker 的无根容器替代方案。

NixNix

通过 Nix flake 进行声明式安装。

AnsibleAnsible

自动化集群配置。

BunBun

通过 Bun 运行时仅使用 CLI。

Terminal window
openclaw --version # confirm the CLI is available
openclaw doctor # check for config issues
openclaw gateway status # verify the Gateway is running

如果您希望在安装后进行托管启动:

  • macOS:通过 macOSopenclaw onboard --install-daemon 或 openclaw gateway install 使用 LaunchAgent
  • Linux/WSL2:通过相同的命令使用 systemd 用户服务
  • 原生 Windows:优先使用计划任务,如果拒绝创建任务,则回退到针对每个用户的启动文件夹登录项

在云服务器或 VPS 上部署 OpenClaw:

VPS

任何 Linux VPS。

DockerDocker VM

共享 Docker 步骤。

Kubernetes

K8s 部署。

Fly.ioFly.io

在 Fly.io 上部署。

HetznerHetzner

Hetzner 部署。

GCPGCP

Google Cloud 部署。

Azure

Azure 部署。

Railway

Railway 部署。

Render

Render 部署。

Northflank

Northflank 部署。

Updating

保持 OpenClaw 为最新。

Migrating

迁移到新机器。

Uninstall

完全移除 OpenClaw。

如果安装成功但终端中找不到 openclaw:

Terminal window
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):

Terminal window
export PATH="$(npm prefix -g)/bin:$PATH"

然后打开一个新的终端窗口。有关更多详细信息,请参阅 Node 设置。