OpenClaw 安装教程
本文档整合 OpenClaw 中文社区 安装说明与 飞书接入教程,从零完成安装并接入飞书。
一、安装 OpenClaw
1.1 环境说明
1.2 macOS / Linux(一键脚本)
国际源:
curl -fsSL https://clawd.org.cn/install.sh | bash
国内镜像:
curl -fsSL https://clawd.org.cn/install.sh | bash -s -- --registry https://registry.npmmirror.com
1.3 Windows(PowerShell)
国际源:
iwr -useb https://clawd.org.cn/install.ps1 | iex国内镜像:
iwr -useb https://clawd.org.cn/install.ps1 -OutFile install.ps1; ./install.ps1 -Registry https://registry.npmmirror.com1.4 npm 全局安装
# 国际源
npm install -g openclaw-cn@latest
# 国内镜像
npm install -g openclaw-cn@latest --registry https://registry.npmmirror.com
安装后执行向导:
openclaw-cn onboard
1.5 pnpm 全局安装
# 国际源
pnpm add -g openclaw-cn@latest
# 国内镜像
pnpm add -g openclaw-cn@latest --registry https://registry.npmmirror.com
同样执行:
openclaw-cn onboard
1.6 Docker 一键部署
适合服务器、NAS,无需单独安装 Node.js:
docker compose up -d
详细步骤见官网 Docker 部署指南。
1.7 首次配置(向导)
安装完成后在终端执行:
openclaw-cn onboard
按提示完成:选择/配置 AI 模型、绑定消息渠道、可选配置技能与权限。
管理页面默认地址:http://127.0.0.1:18789(云服务器可通过 SSH 隧道访问)。
二、飞书接入保姆级教程
2.1 前提条件
2.2 创建飞书企业自建应用
步骤 1:打开飞书开发者平台
浏览器访问 https://open.feishu.cn/app,使用飞书账号登录。
步骤 2:创建应用
步骤 3:添加机器人能力
步骤 4:获取应用凭证
2.3 事件与权限配置
2.3.1 事件配置(必须用长连接)
⚠️ 必须选「长连接」模式,这样无需公网 IP 和回调地址,OpenClaw 可主动连接飞书接收消息。
2.3.2 添加事件订阅
2.3.3 权限配置(批量导入)
{
"scopes": {
"tenant": [
"contact:user.base:readonly",
"im:chat",
"im:chat:read",
"im:chat:update",
"im:message",
"im:message.group_at_msg:readonly",
"im:message.p2p_msg:readonly",
"im:message:send_as_bot",
"im:resource"
],
"user": []
}
}
确认列表中出现上述权限即表示导入成功。
2.3.4 发布应用
2.4 在 OpenClaw 中配置飞书
http://127.0.0.1:18789(云服务器可用 SSH 隧道:ssh -L 18789:127.0.0.1:18789 用户名@服务器IP,本地浏览器访问 http://127.0.0.1:18789)2.5 验证飞书接入
若收到 AI 回复,即表示飞书接入成功。
2.6 群聊使用说明
群聊中,机器人默认仅在以下情况回复:
可避免刷屏。
三、常见问题
安装与运行
--registry https://registry.npmmirror.com 或国内镜像脚本 | |
飞书相关
四、参考链接

夜雨聆风