出海新手指南
OpenClaw本地部署详细方法
更新时间:2026-03-09 11:40:27
安装前准备工作
- 设备要求:普通电脑一台,Mac/Windows/Linux 均可;Mac 体验最顺畅,Windows 推荐使用 WSL2。
- 网络要求:需要稳定的网络,且能正常访问 GitHub 等开发者网络环境。
- 时间预留:大约需要 15–30 分钟完成配置。
安装方法
一、Mac 系统
方式 1:自动安装(推荐)
- 按
Command + 空格,搜索并打开 macOS 终端。 - 复制执行以下命令:
bash
运行
curl -fsSL https://openclaw.ai/install.sh | bash
- 脚本会自动处理 Node.js、Homebrew(若缺失)等环境,全程 3–10 分钟,中间可能需要输入开机密码,完成后自动启动配置向导。
方式 2:手动安装
- 安装 Homebrew
bash
运行
curl -o- https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash
- Apple Silicon 机型需手动添加 PATH:
bash
运行
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)"
- 安装 Node.js
bash
运行
brew install node@22
- 安装 OpenClaw
bash
运行
npm install -g openclaw@latest openclaw --version # 验证安装
二、Windows 系统
方式 1:PowerShell 原生安装
- 右键「以管理员身份运行」PowerShell。
- 执行命令:
powershell
iwr -useb https://openclaw.ai/install.ps1 | iex
方式 2:WSL2 安装(最稳定推荐)
- 在 PowerShell 中安装 WSL:
powershell
wsl --install
- 打开 WSL 终端(Ubuntu),执行一键安装命令:
bash
运行
curl -fsSL https://openclaw.ai/install.sh | bash
方式 3:手动安装
- 前往 Node.js 官网下载安装包并完成配置。
- 使用 npm 安装 OpenClaw:
bash
运行
npm install -g openclaw@latest
三、Linux 系统
- 参考 Mac 自动安装流程,在终端执行相同的一键安装命令即可:
bash
运行
curl -fsSL https://openclaw.ai/install.sh | bash
配置向导与验证
配置向导
- 安装完成后自动进入交互式向导,用键盘上下键选择、回车确认。
- 推荐选择
QuickStart模式完成基础设置,后续额外选项可先选NO跳过。 - 若跳过向导,可执行命令重新打开:
bash
运行
openclaw onboard --install-daemon
- ⚠️ 安全提醒:OpenClaw 会读取电脑文件,建议在非敏感设备使用或限制访问范围。
验证安装与日常使用
- 检查运行状态:
bash
运行
openclaw status
看到
Gateway service: running即为成功,未运行可执行openclaw gateway start启动。 - 打开对话面板:
bash
运行
openclaw dashboard
浏览器自动打开
http://localhost:18789,可发送测试消息。 - 全面体检(排错):
bash
运行
openclaw doctor
自动检查配置并给出修复建议。
选择 AI 模型提供商
- Anthropic(Claude,推理最强)
- OpenAI(GPT 系列,速度快)
- DeepSeek(国内推荐,支持支付宝充值)
- MiniMax(国产省钱,中文能力强)
- Moonshot AI(Kimi,国内直连)
- Google(Gemini,性价比高)
- 向导会要求选择模型,需前往对应官网创建 API Key 并填入,可选提供商:
- 默认模型推荐:Claude Sonnet 4.5、OpenAI GPT-4o、DeepSeek Chat、MiniMax M2.5。


