OpenClaw安装部署(Windows/Linux/MacOS)

确认电脑环境

1.是否装有Git和Node.js
复制代码
# 确认node环境
node --version
# 确认git环境
git --version
2.安装openclaw
复制代码
## windows环境部署Openclaw
powershell -c "irm https://openclaw.ai/install.ps1 | iex"
iwr -useb https://openclaw.ai/install.ps1 | iex
## MacOs环境部署Openclaw
curl -fsSL https://openclaw.ai/install.sh | bash
  • Git

  • Node.js --- 推荐 Node 24(也支持 Node 22.16+)

3.部署完毕
复制代码
## 运行引导
openclaw onboard --install-daemon
## 重启OpenClaw
openclaw gateway restart
## 启动
openclaw gateway run
## 打开OpenClaw浏览器页面(带令牌):
openclaw dashboard

接入微信/企业微信/飞书/钉钉

微信
第一步:启用微信插件
  • 打开手机微信 →【我】→【设置】→【插件】→ 找到并启用"微信 ClawBot"插件。

  • 若未看到该插件,可尝试更新微信至8.0.69及以上版本,或通过"微信派"公众号获取最新入口。

第二步:在 OpenClaw 中安装并绑定插件
  • 在运行 OpenClaw 的终端中执行以下命令安装微信插件:
复制代码
npx -y @tencent-weixin/openclaw-weixin-cli@latest install
  • 若遇到速率限制(429错误),可稍等后重试,或手动安装:
复制代码
openclaw plugins install "@tencent-weixin/openclaw-weixin@latest"
  • 安装完成后,OpenClaw 会生成一个绑定二维码。

  • 打开微信"微信 ClawBot"插件页 → 点击"开始扫一扫" → 扫描该二维码 → 确认授权(消息收发、插件通信等权限)。

第三步:验证连接状态
  • 绑定成功后,微信聊天列表会出现"微信 ClawBot"会话窗口。

  • 在 OpenClaw 终端执行 openclaw channels status,若输出包含 Channel: weixin, Status: enabled, Connection: connected,即表示对接成功。

  • 此时可直接在微信中向"微信 ClawBot"发送指令,如"帮我找一张龙虾表情包"或"创建一个文档",AI 将自动响应并返回结果。

企业微信

第一步:在企业微信创建智能机器人

  1. 登录企业微信管理后台,进入「应用管理」→「智能机器人」。

  2. 点击「创建机器人」,填写名称、头像和简介后保存。

  3. 在机器人详情页,点击「API模式」→「使用长连接」,然后点击「获取 Secret」。

  4. 复制并妥善保存生成的 Bot IDSecret,这是后续对接的关键凭证。

第二步:在OpenClaw中安装并配置企微插件

  1. 在运行 OpenClaw 的终端中执行以下命令安装企业微信通道插件:
复制代码
openclaw channels install wecom
  1. 安装完成后,打开 OpenClaw 的控制界面,进入「聊天配置」→「企业微信(WeCom)」。

  2. 将之前复制的 Bot ID 和 Secret 粘贴到对应输入框中,点击「保存渠道配置」。

第三步:验证连接与功能测试

  1. 重启 OpenClaw 网关服务使配置生效:
复制代码
openclaw gateway restart
  1. 回到企业微信管理后台,确认机器人状态为"已启用"。

  2. 在企业微信中向该机器人发送一条测试消息(如"你好"),若能在3-5秒内收到AI回复,即表示对接成功。

飞书
复制代码
​暂无
钉钉
复制代码
暂无

切换大模型

复制代码
# 以阿里云百炼为例
openclaw config set models.providers.bailian --json '{
  "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
  "apiKey": "sk-your-api-key",
  "defaultModel": "qwen-max"
}'

# 设置为默认使用的模型
openclaw config set models.default "bailian:qwen-max"

问题解决

复制代码
openclaw config set gateway.auth.mode "password"
openclaw config set gateway.auth.password "test123"
openclaw config set gateway.bind "lan"
openclaw config set gateway.controlUi.allowInsecureAuth true
openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth true
openclaw config set agents.defaults.timeoutSeconds 1800
openclaw gateway restart
修改认证模式
复制代码
## 1. 将认证模式修改为 password
openclaw config set gateway.auth.mode "password"
## 2. 设置你的登录密码(请替换为你自己的强密码)
openclaw config set gateway.auth.password "test123"
## 3. 重启网关服务使配置生效
openclaw gateway restart
解除仅本地访问
复制代码
# 将网关绑定模式修改为 lan(即监听 0.0.0.0)
openclaw config set gateway.bind "lan"
## 3. 重启网关服务使配置生效
openclaw gateway restart
修改为远程访问
复制代码
##1. 允许非安全认证(允许 HTTP 下使用密码/Token 登录)
openclaw config set gateway.controlUi.allowInsecureAuth true
## 2. 禁用设备身份验证(绕过浏览器的安全上下文检查)
openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth true
## 3. 重启网关服务使配置生效
openclaw gateway restart
openclaw gateway restart
openclaw gateway restart
超时导致的任务失效
复制代码
# 将默认超时从600秒调整为1800秒(30分钟)
openclaw config set agents.defaults.timeoutSeconds 1800

# 重启网关使配置生效
openclaw gateway restart

此操作可覆盖绝大多数长文本生成、文件处理、多轮推理等场景。若仍超时,可进一步设为 3600(1小时)。

其他

复制代码
openclaw gateway stop
openclaw config set gateway.port 8888
openclaw gateway start
# 1. 停止当前运行的服务
openclaw gateway stop
# 2. 将端口修改为目标端口(例如 8080)
openclaw config set gateway.port 8080
# 3. 重新启动服务使配置生效
openclaw gateway start

运行以下命令,让 OpenClaw 自动帮你检查网络、配置文件和 API 密钥的状态:

复制代码
openclaw doctor

在终端中运行以下命令启动配置向导

复制代码
openclaw onboard

OpenClaw 已经为你提供了内置的修复工具。根据报错提示,直接在终端中运行以下命令即可尝试自动修复配置错误:

复制代码
openclaw doctor --fix

#注:你也可以先运行 openclaw config validate 来查看具体的语法错误位置)

验证配置是否生效

复制代码
openclaw config validate

卸载

复制代码
openclaw uninstall --all --yes --non-interactive
复制代码
相关推荐
FoldWinCard17 小时前
D5 Linux 网络及端口命令
linux·运维·服务器
spencer_tseng18 小时前
Redis + Nacos.bat
java·windows·dos
零涂毕业设计19 小时前
毕业设计模块开发-OLED显示屏(IIC协议0.96寸)STM32 ESP32 FPGA Linux驱动免费分享
linux·stm32·单片机·嵌入式·esp32·fpga·oled
tedcloud12319 小时前
OmniRoute怎么部署?开源AI模型路由平台Linux部署教程
linux·服务器·人工智能·开源·音视频
霸道流氓气质19 小时前
KMS 密钥管理服务(Key Management Service)原理与实践
linux·服务器·数据库
SakitamaX19 小时前
LVS(Linux Virtual Server)概念详解
linux·运维·lvs
小张同学a.19 小时前
Linux系统管理
linux·运维
会飞的小新19 小时前
Windows CMD 与 PowerShell 深度解析:底层原理、命令差异、自动化选型指南
运维·windows·自动化
阿龙的工作记录20 小时前
深入理解Linux设备驱动模型
linux·嵌入式硬件·工作记录
代码村新手20 小时前
Linux的基本指令
linux·运维·服务器