《零基础搞定!OpenClaw 在 Ubuntu 上的部署指南》
(MiniMax 大模型 + 飞书消息通道)
前言
最近在折腾ubuntu服务器部署 OpenClaw小龙虾
本文记录完整的部署过程,包含 MiniMax 模型配置和飞书机器人接入,适合想自己搭建OpenClaw小龙虾的小伙伴。
一、环境准备
1.1 服务器
- 系统:Ubuntu 24.04.4 LTS
- 内存:8GB
- 磁盘:500GB+
- 网络:能够访问 openclaw.ai 和 MiniMax API
1.2 安装 Node.js
OpenClaw 基于 Node.js,需要先安装环境:
# 使用 nvm 安装 Node.js(推荐)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 22
node --version # 确认版本
二、安装 OpenClaw
2.1 下载 CLI,通过 npm 全局安装,并启动设置向导。
curl -fsSL https://openclaw.ai/install.sh | bash
2.2 验证安装
openclaw --version
openclaw doctor # 检查配置问题
openclaw status # Gateway 网关状态
openclaw dashboard # 打开浏览器 UI
三、配置 MiniMax 大模型
3.1 获取 MiniMax API Key
- 访问 MiniMax 开放平台
- 注册账号并完成认证
- 在控制台创建 API Key
3.2 配置模型
通过 CLI 配置:
openclaw configure
选择授权方式,可以网页授权,可以直接填apiKey授权
我这里选择的第三个,直接填API Key
这里配置完模型使用的是MiniMax2.5,直接在~/.openclaw/openclaw.json配置文件中修改成MiniMax2.7
"models": {
"mode": "merge",
"providers": {
"minimax-cn": {
"baseUrl": "https://api.minimaxi.com/anthropic",
"api": "anthropic-messages",
"authHeader": true,
"models": [
{
"id": "MiniMax-M2.7",
"name": "MiniMax M2.7",
"reasoning": true,
"input": [
"text"
],
"cost": {
"input": 0.3,
"output": 1.2,
"cacheRead": 0.03,
"cacheWrite": 0.12
},
"contextWindow": 200000,
"maxTokens": 8192
}
]
},
...
"agents": {
"defaults": {
"model": {
"primary": "minimax-cn/MiniMax-M2.7",
"fallbacks": [
]
...
3.3 验证模型配置
openclaw models list
四、配置飞书消息通道
4.1 创建飞书应用
- 进入 飞书开放平台
- 点击「创建企业自建应用」
- 填写应用名称和描述
- 获取
App ID和App Secret
4.2 配置消息订阅
在飞书开放平台,找到「事件与回调」:
- 订阅方式:选择长连接
- 订阅事件:选择
im.message.receive_v1(接收消息)
- 配置权限:选择权限管理
{
"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:write",
"contact:contact.base:readonly",
"contact:user.employee_id:readonly",
"corehr:file:download",
"docs:document.content:read",
"docx:document",
"docx:document.block:convert",
"docx:document:create",
"docx:document:readonly",
"docx:document:write_only",
"drive:drive",
"drive:drive.metadata:readonly",
"drive:drive.search:readonly",
"drive:drive:readonly",
"drive:drive:version",
"drive:drive:version:readonly",
"drive:export:readonly",
"drive:file",
"drive:file.like:readonly",
"drive:file.meta.sec_label.read_only",
"drive:file:download",
"drive:file:readonly",
"drive:file:upload",
"drive:file:view_record:readonly",
"event:ip_list",
"im:chat",
"im:chat.access_event.bot_p2p_chat:read",
"im:chat.members:bot_access",
"im:message",
"im:message.group_at_msg:readonly",
"im:message.group_msg",
"im:message.p2p_msg:readonly",
"im:message:readonly",
"im:message:send_as_bot",
"im:resource",
"sheets:spreadsheet",
"wiki:wiki:readonly"
],
"user": [
"aily:file:read",
"aily:file:write",
"im:chat.access_event.bot_p2p_chat:read"
]
}
}
4.3 配置渠道
如果你使用的是较旧版本,或使用了不包含捆绑飞书的自定义安装,请手动安装:
openclaw plugins install @openclaw/feishu
openclaw channels add
选择 Feishu,然后粘贴 App ID 和 App Secret。
4.4 启动服务
# 启动 OpenClaw Gateway
openclaw gateway start
# 查看状态
openclaw gateway status
五、创建多智能体助手
- 在飞书上创建开发部、设计部、投资部、创意部消息群,将刚创建的openclaw机器人加入群聊,并记录下每个群会话ID
2. 在openclaw创建智能体
openclaw agents add coding #开发部
openclaw agents add design #设计部
openclaw agents add investment #投资部
openclaw agents add idea #创意部
- 渠道配置:修改配置文件
~/.openclaw/openclaw.json,给每个智能体绑定消息渠道
"agents": {
"defaults": {
"model": {
"primary": "minimax-cn/MiniMax-M2.7",
"fallbacks": [
]
},
"models": {
"minimax-cn/MiniMax-M2.7": {
"alias": "Minimax"
}
},
"workspace": "/home/***/.openclaw/workspace",
"memorySearch": {
"enabled": true,
"sources": [
"memory",
"sessions"
],
"experimental": {
"sessionMemory": true
},
"provider": "local",
"fallback": "none",
"local": {
"modelPath": "/home/***/.openclaw/models/all-MiniLM-L6-v2.Q4_K_M.gguf"
},
"store": {
"vector": {
"enabled": true
}
},
"cache": {
"enabled": true,
"maxEntries": 50000
}
},
"compaction": {
"mode": "safeguard",
"reserveTokensFloor": 20000,
"memoryFlush": {
"enabled": true,
"softThresholdTokens": 4000,
"prompt": "Write any lasting notes to memory/YYYY-MM-DD.md; reply with NO_REPLY if nothing to store.",
"systemPrompt": "session nearing compaction. Store durable memories now."
}
},
"heartbeat": {
"every": "30m",
"model": "/home/***/.openclaw/models/all-MiniLM-L6-v2.Q4_K_M.gguf"
},
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
}
},
"list": [
{
"id": "main"
},
{
"id": "coding",
"name": "coding",
"workspace": "/home/***/.openclaw/workspace-coding",
"agentDir": "/home/***/.openclaw/agents/coding/agent",
"model": "minimax-cn/MiniMax-M2.7"
},
{
"id": "design",
"name": "design",
"workspace": "/home/***/.openclaw/workspace-design",
"agentDir": "/home/***/.openclaw/agents/design/agent",
"model": "minimax-cn/MiniMax-M2.7"
},
{
"id": "investment",
"name": "investment",
"workspace": "/home/***/.openclaw/workspace-investment",
"agentDir": "/home/***/.openclaw/agents/investment/agent",
"model": "minimax-cn/MiniMax-M2.7"
},
{
"id": "idea",
"name": "idea",
"workspace": "/home/***/.openclaw/workspace-idea",
"agentDir": "/home/***/.openclaw/agents/idea/agent",
"model": "minimax-cn/MiniMax-M2.7"
},
...
六、常见问题
Q1:消息收不到?
- 检查
config.yaml中的appId和appSecret是否正确 - 确认飞书应用已开启「机器人」能力
- 确认已添加应用到他所在的群
Q2:模型不响应?
- 确认 API Key 有效
- 检查服务器网络能否访问 MiniMax API
- 查看
openclaw logs排查具体错误
Q3:如何自定义机器人人格?
在 workspace 目录下创建 SOUL.md 文件,编写你的人格设定。
结语
以上就是 OpenClaw 在 Ubuntu 上的完整部署流程。
配合 MiniMax 大模型的强大能力,再加上飞书消息通道的便捷性,你可以轻松搭建一个属于自己的 AI 助手。
有问题欢迎留言交流 🙂
关注我,持续分享 AI 助手搭建与使用技巧 🚀
</final>