乐于分享
好东西不私藏

OpenClaw 安装指南:从入门到精通

OpenClaw 安装指南:从入门到精通

OpenClaw 是一个强大的 AI 助手框架,本文将详细介绍如何在你的系统上安装和配置它。

快速安装(推荐)

最简单的方式是使用官方安装器脚本:

macOS / Linux:

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

Windows (PowerShell):

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

安装完成后,运行新手引导:

openclaw onboard --install-daemon

系统要求

  • Node.js >= 22
  • • macOS、Linux 或通过 WSL2 的 Windows
  • pnpm 仅在从源代码构建时需要

安装方式详解

方式一:安装器脚本(推荐)

安装器会自动完成以下步骤:

  • • 通过 npm 全局安装 openclaw
  • • 运行交互式新手引导

常用安装器标志:

  • --install-method npm|git:选择安装方式
  • --no-onboard:跳过新手引导
  • --dry-run:预览安装步骤

方式二:全局安装(手动)

如果你已有 Node.js 环境:

npm install -g openclaw@latest

方式三:从源代码构建

适合贡献者和开发者:

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

方式四:其他安装选项

  • Docker:容器化部署
  • Nix:声明式包管理
  • Ansible:自动化配置
  • Bun:轻量级运行时

安装后检查

安装完成后,建议运行以下命令确认一切正常:

openclaw doctor        # 快速诊断
openclaw status        # 检查 Gateway 状态
openclaw health        # 健康检查
openclaw dashboard     # 打开仪表板

常见问题:找不到 openclaw 命令

如果终端提示找不到 openclaw,通常是 PATH 配置问题。

诊断步骤:

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

修复方法:

~/.zshrc~/.bashrc 中添加:

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

然后重新打开终端。

更多资源

  • 更新指南:docs.openclaw.ai/install/updating[1]
  • 迁移指南:docs.openclaw.ai/install/migrating[2]
  • 卸载指南:docs.openclaw.ai/install/uninstall[3]

OpenClaw - 你的智能助手框架

引用链接

[1] docs.openclaw.ai/install/updating: https://docs.openclaw.ai/install/updating
[2] docs.openclaw.ai/install/migrating: https://docs.openclaw.ai/install/migrating
[3] docs.openclaw.ai/install/uninstall: https://docs.openclaw.ai/install/uninstall