概述

已经按照 Getting Started 操作?您已经设置好了——本页面介绍替代安装方法、平台特定说明和维护。

系统要求

  • Node 22+安装脚本 会在缺失时安装)
  • macOS、Linux 或 Windows
  • 仅当从源码构建时需要 pnpm

安装方法

推荐方法(一键安装)

macOS/Linux:

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

Windows (PowerShell):

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

其他安装方法

1.npm 全局安装

npm install -g openclaw

2.Git 源码安装(可 hack 版本)**

git clone https://github.com/openclaw/openclaw.git
cd openclaw
pnpm install
pnpm build

3.Docker 安装

参见 Docker 安装指南

安装后验证

验证一切正常工作:

openclaw doctor          # 检查配置问题
openclaw status          # 网关状态
openclaw dashboard       # 打开浏览器 UI

故障排除: 找不到 openclaw 命令

PATH 诊断和修复

快速诊断:

node -v
npm -v
npm prefix -g
echo "$PATH"

如果 $(npm prefix -g)/bin(macOS/Linux)或 $(npm prefix -g)(Windows)不在您的 $PATH 中,您的 shell 找不到全局 npm 二进制文件(包括 openclaw)。

修复 - 添加到 shell 启动文件(~/.zshrc~/.bashrc):

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

在 Windows 上,将 npm prefix -g 的输出添加到您的 PATH。

然后打开新终端(或在 zsh 中运行 rehash / 在 bash 中运行 hash -r)。

更新 / 卸载

更新 OpenClaw

openclaw update

或指定版本:

npm install -g openclaw@latest

卸载 OpenClaw

npm uninstall -g openclaw

删除状态目录(警告:这将删除所有配置和会话)

rm -rf ~/.openclaw

平台特定说明

macOS

  • 需要 Xcode Command Line Tools
  • 可能需要额外权限(完全磁盘访问等)

Linux

  • 支持 Ubuntu、Debian、CentOS 等主流发行版
  • 可能需要 sudo 权限进行全局安装

Windows

  • 推荐 WSL2 以获得最佳体验
  • 或使用 PowerShell 进行原生安装

相关文档

来源:https://docs.openclaw.ai/install

作者:十一张  创建时间:2026-03-08 20:11
最后编辑:十一张  更新时间:2026-03-08 22:48