这是一个以win11本地环境搭建OpenClaw的教程
官方文档地址
注意:API KEY是有额度的超出是需要费用,免费的可以试用,不要因为使用过度使用导致扣费超出了心里预期价格
一、环境准备
1.1 Node.js(必须)
OpenClaw运行环境,Node必须 ≥ v22
1.2 Git
因为需要拉取镜像,需要安装有Git,否则PowerShell窗口会闪退
1.3 API KEY(必须)
国内用户使用阿里云百炼或MiniMax
- 阿里云百炼获取:登录阿里云百炼控制台 → 密钥管理 → 创建API-Key,保存 Access Key ID 和 Access Key Secret
终端工具
- Windows:以管理员身份运行 PowerShell(右键点击选择)
二、Windows 11本地部署
2.1 解锁PowerShell执行权限(可能不需要)
Set-ExecutionPolicy Bypass-Scope Process-Force2.2 一键安装OpenClaw
#官方脚本iwr-useb https://openclaw.ai/install.ps1|iex或者使用国内镜像
iwr-useb https://clawd.org.cn/install.ps1|iex等待安装即可
这里选择快速安装,等待执行即可
这里会让你选择模型提供商和API KEY,这就是前面需要准备的,这里选的阿里云百炼其他的选择就根据自己的选则,等待成功就行
2.3 验证安装
openclaw--version# 应输出如 0.1.8-fix.32.4 配置并启动服务
openclaw config set gateway.mode local# 设为本地模式openclaw gateway install# 安装为Windows计划任务(开机自启)openclaw gateway start# 启动服务openclaw gateway status# 检查状态,应为Running2.5 访问Web控制台
浏览器打开:http://127.0.0.1:18789
2.6 如果出现错误
如果出现: disconnected (1008): unauthorized: gateway token missing (open a tokenized dashboard URL or paste token in Control UI settings)event gap detected (expected seq 400, got 404); refresh recommended ,查看官方文档有提供执行命令
#运行 openclaw dashboard 获取新的带 token 链接 openclaw dashboard
执行结束后会根据这个链接打开浏览器,这样就正常了
三、能做什么
关注动态,等什么时候能帮助到我们再来使用