新手教程
24.04实战
OpenClaw安装配置指南:VMware Ubuntu 24.04实战教程
摘要
OpenClaw 部署与飞书集成完全指南 最近有个开源项目挺火的,叫 OpenClaw,上线短短几个月就
# OpenClaw 部署与飞书集成完全指南
最近有个开源项目挺火的,叫 OpenClaw,上线短短几个月就冲上了 GitHub 热门榜,目前 star 数已经 24.3w 了。
它为什么能这么火?说白了,是切中了一个很实在的痛点——目前的 AI 助手基本还停留在“聊聊天”的阶段,真正能落地执行的、能记住上下文的、能安全可控的、还能灵活扩展的,实在太少了。OpenClaw 用五招解决了这个问题:本地执行、多渠道统一、模型无关、安全可控、插件生态。听起来就不太像是“又一个套壳”的东西。
这次我们以 VMware + Ubuntu 24.04 环境为例,把 OpenClaw 从零装起来,并且打通飞书机器人。
---
第一次安装时间会比较长,耐心等就好。
### 配置
安装完成后,终端会自动弹出配置界面。另外,为了方便后续在终端识别 OpenClaw 命令,别忘了在 `~/.bashrc` 里加上一行:
```
export PATH="/home/xsf/.npm-global/bin:$PATH"
```
以下是配置页面:
配置页面的操作很简单:上下左右键是选择,空格是勾选,回车是确认并继续。
接下来的步骤一个个来:
确认条款,选 `Yes`,回车:
```
◆ I understand this is personal-by-default and shared/multi-user use requires lock-down. Continue?
│ ● Yes / ○ No
```
入职模式选 `QuickStart`,后续可以再细调:
```
◆ Onboarding mode
│ ● QuickStart (Configure details later via openclaw configure.)
│ ○ Manual
```
选择 LLM 提供商。这里我选的是 `MiniMax (M2.5 (recommended))`:
```
◆ Model/auth provider
│ ○ OpenAI
│ ○ Anthropic
│ ○ Chutes
│ ○ vLLM
│ ● MiniMax (M2.5 (recommended))
│ ○ Moonshot AI (Kimi K2.5)
│ ○ Google
│ ○ xAI (Grok)
│ ○ Mistral AI
│ ○ Volcano Engine
│ ○ BytePlus
```
因为用的是国内的 API,后面选 `MiniMax M2.5 (CN)`:
```
◆ MiniMax auth method
│ ○ MiniMax OAuth
│ ○ MiniMax M2.5
│ ● MiniMax M2.5 (CN) (China endpoint (api.minimaxi.com))
│ ○ MiniMax M2.5 Lightning
│ ○ Back
```
到这步需要输入 API 密钥了:
```
◆ How do you want to provide this API key?
│ ● Paste API key now (Stores the key directly in OpenClaw config)
│ ○ Use secret reference
```
如何获取 MiniMax API?登录 https://platform.minimaxi.com/docs/api-reference/api-overview,按以下步骤获取密钥。注意账户里需要先充点钱才能用,首次充值会送 15 元。
充值步骤:
回到正题,输入 API 密钥:
模型选择保持默认 `Keep current (minimax-cn/MiniMax-M2.5)`:
```
◆ Default model
│ ● Keep current (minimax-cn/MiniMax-M2.5)
│ ○ Enter model manually
│ ○ minimax-cn/MiniMax-M2.5
│ ○ minimax-cn/MiniMax-M2
│ ○ minimax-cn/MiniMax-M2.1
│ ○ minimax-cn/MiniMax-M2.5-highspeed
```
移动端接入先跳过:
```
◆ Select channel (QuickStart)
│ ...
│ ○ Google Chat (Chat API)
│ ○ Slack (Socket Mode)
│ ○ Signal (signal-cli)
│ ○ iMessage (imsg)
│ ○ Feishu/Lark (飞书)
│ ○ Nostr (NIP-04 DMs)
│ ○ Microsoft Teams (Bot Framework)
│ ○ Mattermost (plugin)
│ ○ Nextcloud Talk (self-hosted)
│ ○ Matrix (plugin)
│ ○ BlueBubbles (macOS app)
│ ○ LINE (Messaging API)
│ ○ Zalo (Bot API)
│ ○ Zalo (Personal Account)
│ ○ Synology Chat (Webhook)
│ ○ Tlon (Urbit)
│ ● Skip for now (You can add channels later via `openclaw channels add`)
```
skills 暂时不装,后续需要再加:
```
◆ Configure skills now? (recommended)
│ ○ Yes / ● No
```
hook 也先跳过:
```
◇ Hooks ──────────────────────────────────────────────────────────────────╮
│ │
│ Hooks let you automate actions when agent commands are issued. │
│ Example: Sa ve session context to memory when you issue /new or /reset. │
│ │
│ Learn more: https://docs.openclaw.ai/automation/hooks │
│ │
├──────────────────────────────────────────────────────────────────────────╯
│
◆ Enable hooks?
│ ◼ Skip for now
│ ◻ ? boot-md
│ ◻ ? bootstrap-extra-files
│ ◻ ? command-logger
│ ◻ ? session-memory
```
> 后续如果想启用 hook,可以通过:
> - 列出所有 hook:`openclaw hooks list`
> - 启用:`openclaw hooks enable session-memory`
> - 检查状态:`openclaw hooks check`
最后测试一下能否与大模型对话,选 `Hatch in TUI (recommended)`:
```
◆ How do you want to hatch your bot?
│ ● Hatch in TUI (recommended)
│ ○ Open the Web UI
│ ○ Do this later
```
能正常对话,说明配置没毛病。打开 Web UI 可以更方便管理:
到此,OpenClaw 就装好了。
---
定义应用名称和描述,获取 AppID 和 Secret。
回到 OpenClaw,添加飞书通道:
```
openclaw channels add
```
选 `Yes`:
```
◆ Configure chat channels now?
│ ● Yes / ○ No
```
选择 `Feishu/Lark (飞书)`:
```
◆ Select a channel
│ ○ Telegram (Bot API)
│ ○ WhatsApp (QR link)
│ ○ Discord (Bot API)
│ ○ IRC (Server + Nick)
│ ○ Google Chat (Chat API)
│ ○ Slack (Socket Mode)
│ ○ Signal (signal-cli)
│ ○ iMessage (imsg)
│ ● Feishu/Lark (飞书) (needs app creds)
│ ○ Nostr (NIP-04 DMs)
│ ○ Microsoft Teams (Bot Framework)
│ ○ Mattermost (plugin)
│ ○ Nextcloud Talk (self-hosted)
│ ○ Matrix (plugin)
│ ○ BlueBubbles (macOS app)
│ ○ LINE (Messaging API)
│ ○ Zalo (Bot API)
│ ○ Zalo (Personal Account)
│ ...
```
输入 App ID:
输入 App Secret:
选择国内域名:
```
◆ Which Feishu domain?
│ ● Feishu (feishu.cn) - China
│ ○ Lark (larksuite.com) - International
```
群聊策略按需选择,这里选了 `Open`:
```
◆ Group chat policy
│ ○ Allowlist - only respond in specific groups
│ ● Open - respond in all groups (requires mention)
│ ○ Disabled - don't respond in groups
```
最后选 `Finished`:
```
◆ Select a channel
│ ...
│ ○ IRC (Server + Nick)
│ ○ Google Chat (Chat API)
│ ○ Slack (Socket Mode)
│ ○ Signal (signal-cli)
│ ○ iMessage (imsg)
│ ○ Feishu/Lark (飞书)
│ ○ Nostr (NIP-04 DMs)
│ ○ Microsoft Teams (Bot Framework)
│ ○ Mattermost (plugin)
│ ○ Nextcloud Talk (self-hosted)
│ ○ Matrix (plugin)
│ ○ BlueBubbles (macOS app)
│ ○ LINE (Messaging API)
│ ○ Zalo (Bot API)
│ ○ Zalo (Personal Account)
│ ○ Synology Chat (Webhook)
│ ○ Tlon (Urbit)
│ ● Finished (Done)
```
后面如果有其他选项,直接回车默认即可。
**第二步:授予应用权限**
需要申请的权限列表(直接在后台配置):
```
{
"scopes": {
"tenant": [
"aily:file:read",
"aily:file:write",
"application:application.app_message_stats.overview:readonly",
"application:application:self_manage",
"application:bot.menu:write",
"cardkit:card:read",
"cardkit:card:write",
"contact:user.employee_id:readonly",
"corehr:file:download",
"event:ip_list",
"im:chat.access_event.bot_p2p_chat:read",
"im:chat.members:bot_access",
"im:message",
"im:message.group_at_msg:readonly",
"im:message.p2p_msg:readonly",
"im:message:readonly",
"im:message:send_as_bot",
"im:resource"
],
"user": ["aily:file:read", "aily:file:write", "im:chat.access_event.bot_p2p_chat:read"]
}
}
```
**第三步:启用机器人**
**第四步:启用监听事件**
选择事件 `im.message.receive_v1`:
**第五步:发布新版本**
在飞书开发者后台发布应用的新版本:
**第六步:联合调试**
启动 OpenClaw 的网关:
```
openclaw gateway
```
打开飞书的开发者助手:
随便发个消息,获取配对码:
用配对码在 OpenClaw 端完成配对:
```
openclaw pairing approve feishu
OpenClaw 安装配置
### 安装 正式动手之前,先给 Ubuntu 系统换个源,不然下载速度能让人怀疑人生。这里借用小鱼的一键安装指令,选 5 就行: ``` wget http://fishros.com/install -O fishros && . fishros ``` 如果系统已经有 Node.js 环境,装 OpenClaw 非常快。当然它自己也提供了一键安装脚本,会自动把需要的 Node.js、make、gcc、cmake 和 Python3 一起搞定: ``` curl -fsSL https://openclaw.bot/install.sh | bash ```
第一次安装时间会比较长,耐心等就好。
### 配置
安装完成后,终端会自动弹出配置界面。另外,为了方便后续在终端识别 OpenClaw 命令,别忘了在 `~/.bashrc` 里加上一行:
```
export PATH="/home/xsf/.npm-global/bin:$PATH"
```
以下是配置页面:
配置页面的操作很简单:上下左右键是选择,空格是勾选,回车是确认并继续。
接下来的步骤一个个来:
确认条款,选 `Yes`,回车:
```
◆ I understand this is personal-by-default and shared/multi-user use requires lock-down. Continue?
│ ● Yes / ○ No
```
入职模式选 `QuickStart`,后续可以再细调:
```
◆ Onboarding mode
│ ● QuickStart (Configure details later via openclaw configure.)
│ ○ Manual
```
选择 LLM 提供商。这里我选的是 `MiniMax (M2.5 (recommended))`:
```
◆ Model/auth provider
│ ○ OpenAI
│ ○ Anthropic
│ ○ Chutes
│ ○ vLLM
│ ● MiniMax (M2.5 (recommended))
│ ○ Moonshot AI (Kimi K2.5)
│ ○ Google
│ ○ xAI (Grok)
│ ○ Mistral AI
│ ○ Volcano Engine
│ ○ BytePlus
```
因为用的是国内的 API,后面选 `MiniMax M2.5 (CN)`:
```
◆ MiniMax auth method
│ ○ MiniMax OAuth
│ ○ MiniMax M2.5
│ ● MiniMax M2.5 (CN) (China endpoint (api.minimaxi.com))
│ ○ MiniMax M2.5 Lightning
│ ○ Back
```
到这步需要输入 API 密钥了:
```
◆ How do you want to provide this API key?
│ ● Paste API key now (Stores the key directly in OpenClaw config)
│ ○ Use secret reference
```
如何获取 MiniMax API?登录 https://platform.minimaxi.com/docs/api-reference/api-overview,按以下步骤获取密钥。注意账户里需要先充点钱才能用,首次充值会送 15 元。
充值步骤:
回到正题,输入 API 密钥:
模型选择保持默认 `Keep current (minimax-cn/MiniMax-M2.5)`:
```
◆ Default model
│ ● Keep current (minimax-cn/MiniMax-M2.5)
│ ○ Enter model manually
│ ○ minimax-cn/MiniMax-M2.5
│ ○ minimax-cn/MiniMax-M2
│ ○ minimax-cn/MiniMax-M2.1
│ ○ minimax-cn/MiniMax-M2.5-highspeed
```
移动端接入先跳过:
```
◆ Select channel (QuickStart)
│ ...
│ ○ Google Chat (Chat API)
│ ○ Slack (Socket Mode)
│ ○ Signal (signal-cli)
│ ○ iMessage (imsg)
│ ○ Feishu/Lark (飞书)
│ ○ Nostr (NIP-04 DMs)
│ ○ Microsoft Teams (Bot Framework)
│ ○ Mattermost (plugin)
│ ○ Nextcloud Talk (self-hosted)
│ ○ Matrix (plugin)
│ ○ BlueBubbles (macOS app)
│ ○ LINE (Messaging API)
│ ○ Zalo (Bot API)
│ ○ Zalo (Personal Account)
│ ○ Synology Chat (Webhook)
│ ○ Tlon (Urbit)
│ ● Skip for now (You can add channels later via `openclaw channels add`)
```
skills 暂时不装,后续需要再加:
```
◆ Configure skills now? (recommended)
│ ○ Yes / ● No
```
hook 也先跳过:
```
◇ Hooks ──────────────────────────────────────────────────────────────────╮
│ │
│ Hooks let you automate actions when agent commands are issued. │
│ Example: Sa ve session context to memory when you issue /new or /reset. │
│ │
│ Learn more: https://docs.openclaw.ai/automation/hooks │
│ │
├──────────────────────────────────────────────────────────────────────────╯
│
◆ Enable hooks?
│ ◼ Skip for now
│ ◻ ? boot-md
│ ◻ ? bootstrap-extra-files
│ ◻ ? command-logger
│ ◻ ? session-memory
```
> 后续如果想启用 hook,可以通过:
> - 列出所有 hook:`openclaw hooks list`
> - 启用:`openclaw hooks enable session-memory`
> - 检查状态:`openclaw hooks check`
最后测试一下能否与大模型对话,选 `Hatch in TUI (recommended)`:
```
◆ How do you want to hatch your bot?
│ ● Hatch in TUI (recommended)
│ ○ Open the Web UI
│ ○ Do this later
```
能正常对话,说明配置没毛病。打开 Web UI 可以更方便管理:
到此,OpenClaw 就装好了。
---
连接飞书
接下来要把 OpenClaw 接入飞书,变成一个真正能用的聊天机器人。官方文档地址:https://docs.openclaw.ai/channels/feishu **第一步:创建飞书应用** 打开飞书开发者后台:https://open.feishu.cn/app,选择「企业自建应用」。
定义应用名称和描述,获取 AppID 和 Secret。
回到 OpenClaw,添加飞书通道:
```
openclaw channels add
```
选 `Yes`:
```
◆ Configure chat channels now?
│ ● Yes / ○ No
```
选择 `Feishu/Lark (飞书)`:
```
◆ Select a channel
│ ○ Telegram (Bot API)
│ ○ WhatsApp (QR link)
│ ○ Discord (Bot API)
│ ○ IRC (Server + Nick)
│ ○ Google Chat (Chat API)
│ ○ Slack (Socket Mode)
│ ○ Signal (signal-cli)
│ ○ iMessage (imsg)
│ ● Feishu/Lark (飞书) (needs app creds)
│ ○ Nostr (NIP-04 DMs)
│ ○ Microsoft Teams (Bot Framework)
│ ○ Mattermost (plugin)
│ ○ Nextcloud Talk (self-hosted)
│ ○ Matrix (plugin)
│ ○ BlueBubbles (macOS app)
│ ○ LINE (Messaging API)
│ ○ Zalo (Bot API)
│ ○ Zalo (Personal Account)
│ ...
```
输入 App ID:
输入 App Secret:
选择国内域名:
```
◆ Which Feishu domain?
│ ● Feishu (feishu.cn) - China
│ ○ Lark (larksuite.com) - International
```
群聊策略按需选择,这里选了 `Open`:
```
◆ Group chat policy
│ ○ Allowlist - only respond in specific groups
│ ● Open - respond in all groups (requires mention)
│ ○ Disabled - don't respond in groups
```
最后选 `Finished`:
```
◆ Select a channel
│ ...
│ ○ IRC (Server + Nick)
│ ○ Google Chat (Chat API)
│ ○ Slack (Socket Mode)
│ ○ Signal (signal-cli)
│ ○ iMessage (imsg)
│ ○ Feishu/Lark (飞书)
│ ○ Nostr (NIP-04 DMs)
│ ○ Microsoft Teams (Bot Framework)
│ ○ Mattermost (plugin)
│ ○ Nextcloud Talk (self-hosted)
│ ○ Matrix (plugin)
│ ○ BlueBubbles (macOS app)
│ ○ LINE (Messaging API)
│ ○ Zalo (Bot API)
│ ○ Zalo (Personal Account)
│ ○ Synology Chat (Webhook)
│ ○ Tlon (Urbit)
│ ● Finished (Done)
```
后面如果有其他选项,直接回车默认即可。
**第二步:授予应用权限**
需要申请的权限列表(直接在后台配置):
```
{
"scopes": {
"tenant": [
"aily:file:read",
"aily:file:write",
"application:application.app_message_stats.overview:readonly",
"application:application:self_manage",
"application:bot.menu:write",
"cardkit:card:read",
"cardkit:card:write",
"contact:user.employee_id:readonly",
"corehr:file:download",
"event:ip_list",
"im:chat.access_event.bot_p2p_chat:read",
"im:chat.members:bot_access",
"im:message",
"im:message.group_at_msg:readonly",
"im:message.p2p_msg:readonly",
"im:message:readonly",
"im:message:send_as_bot",
"im:resource"
],
"user": ["aily:file:read", "aily:file:write", "im:chat.access_event.bot_p2p_chat:read"]
}
}
```
**第三步:启用机器人**
**第四步:启用监听事件**
选择事件 `im.message.receive_v1`:
**第五步:发布新版本**
在飞书开发者后台发布应用的新版本:
**第六步:联合调试**
启动 OpenClaw 的网关:
```
openclaw gateway
```
打开飞书的开发者助手:
随便发个消息,获取配对码:
用配对码在 OpenClaw 端完成配对:
```
openclaw pairing approve feishu
```
再发一条消息试试——机器人已经可以正常回复了。
至此,OpenClaw 与飞书的集成全部完成。 来源:互联网
免责声明
本网站新闻资讯均来自公开渠道,力求准确但不保证绝对无误,内容观点仅代表作者本人,与本站无关。若涉及侵权,请联系我们处理。本站保留对声明的修改权,最终解释权归本站所有。