学习进度 · 登录后可记录
Mac 本地部署 OpenClaw 最佳体验:如果你有 Mac 电脑,强烈推荐本地部署,体验最好、功能最全!
操作步骤:
Command + 空格 打开 Spotlight(Mac 搜索功能)Terminal 或「终端」
💡 小贴士:也可以按 Command + Shift + U 从 Finder 打开「实用工具」文件夹找到终端
在终端中执行以下命令(复制粘贴即可):
curl -fsSL https://openclaw.ai/install.sh | bash安装过程会自动完成:
⏱️ 预计时间:2-5 分钟
执行命令:
openclaw --version预期输出:如 2026.2.9(版本号可能不同,以实际为准)
执行命令:
openclaw onboard配置流程(共 10 步):
Yes 继续QuickStart

18789,直接回车no执行命令:
openclaw channels status预期输出:Gateway reachable.
openclaw gateway start # 启动服务
openclaw gateway enable # 开机自启(推荐)http://127.0.0.1:18789/chatopenclaw gateway stop
curl -fsSL https://openclaw.ai/install.sh | sudo bashopenclaw updateopenclaw uninstallopenclaw channels statusopenclaw gateway start| 步骤 | 操作 |
|---|---|
| 1 | 打开终端 |
| 2 | 执行安装命令 |
| 3 | 验证安装 |
| 4 | 运行配置 |
| 5 | 验证 Gateway |
| 6 | 打开 Web UI |
| 7 | 设置开机自启 |
Windows 用户:完全可用,但部分系统集成功能受限。
(配图:红黑配色风格,含OpenClaw字样及红色小图标)
Windows有两种部署方式:
这是官方推荐的Windows部署方式,提供最完整的Linux环境支持。
以管理员身份打开PowerShell,执行:
# 启用WSL功能
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# 设置WSL 2为默认版本
wsl --set-default-version 2重启计算机。
方法一:Microsoft Store安装(推荐)
安装完成后会自动打开Ubuntu终端,按提示设置用户名和密码。
在Ubuntu终端中执行:
# 更新软件包列表
sudo apt update && sudo apt upgrade -y
# 安装基础工具
sudo apt install -y curl git wget build-essential# 添加NodeSource仓库
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
# 安装Node.js
sudo apt install -y nodejs
# 验证版本(必须≥22.x)
node -v
npm -v方法A:一键脚本安装
curl -fsSL https://openclaw.ai/install.sh | bash# 查看版本
openclaw --version
# 查看帮助
openclaw --help
# 查看系统状态
openclaw status由于OpenClaw运行在WSL2中,需要配置端口转发以便Windows访问。
创建启动脚本 start-openclaw.bat:
@echo off
echo Starting OpenClaw Gateway in WSL2...
wsl -d Ubuntu-22.04 -u root service openclaw start
timeout 3
start http://localhost:18789或直接在WSL2中启动:
# 在WSL2 Ubuntu终端中
openclaw gateway run --port 18789然后在Windows浏览器访问:http://localhost:18789
适合不想使用WSL2的纯Windows用户。
方法一:官网下载安装
# 打开PowerShell
node -v
npm -v重要:必须以管理员身份运行PowerShell。
# 安装最新稳定版
npm install -g openclaw@latest
# 或安装汉化版
npm install -g @qingchencloud/openclaw-zh@latest如果遇到权限错误:
方法A:启用PowerShell脚本执行
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser方法B:修改npm安装目录
npm config set prefix "C:\npm"
npm config set cache "C:\npm-cache"
# 将目录添加到PATH
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\npm", "User")openclaw --version
openclaw --help问题:sharp模块加载失败
# 清理npm缓存
npm cache clean --force
# 重新安装
npm install -g openclaw@latest --force问题:Windows Defender阻止
将OpenClaw安装目录添加到Windows Defender排除项:
安装完成后,需要运行初始化向导。
openclaw onboard --install-daemonOpenClaw需要对接AI模型才能工作。
以配置Anthropic Claude(推荐)为例:
详细说明:完整的 API Key 配置方式和优先级请参考 API Key 配置完整指南
# WSL2或PowerShell
openclaw models auth add
# 按提示选择 anthropic
# 输入 API Key: sk-ant-xxx创建Bot:
配置:
openclaw channels add telegram
openclaw config set channels.telegram.botToken "your-bot-token"
openclaw gateway restart# 登录WhatsApp(显示二维码)
openclaw channels login whatsapp
# 用手机WhatsApp扫码# 安装企业微信插件
openclaw plugins install @mlheng-clawd/wework
# 配置
openclaw config set channels.wework '{"enabled":true,"corpId":"xxx","agentSecret":"xxx"}' --j# 安装飞书插件
openclaw plugins install @mlheng-clawd/feishu
# 配置
openclaw config set channels.feishu '{"enabled":true,"appId":"cli_xxx","appSecret":"xxx"}' --j| 命令 | 功能 |
|---|---|
| openclaw --version | 查看版本 |
| openclaw status | 查看系统状态 |
| openclaw health | 健康检查 |
| openclaw update | 更新OpenClaw |
| openclaw doctor | 诊断系统问题 |
| 命令 | 功能 |
|---|---|
| openclaw onboard | 初始化向导 |
| openclaw configure | 交互式配置 |
| openclaw config get <key> | 查看配置项 |
| openclaw config set <key> <value> | 修改配置项 |
| openclaw config unset <key> | 删除配置项 |
Linux用户:适合开发者,配置灵活。
推荐发行版:
# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
# 验证安装
node --versioncurl -fsSL https://openclaw.ai/install.sh | bashopenclaw --versionopenclaw onboard