OpenClaw 是一个强大的 AI 助手框架,支持多种消息平台(WhatsApp、Telegram、飞书等)、自定义工具和自动化工作流。本文将带你从零开始,在 10 分钟内完成 OpenClaw 的部署和配置。
OpenClaw 是一个开源的 AI 助手运行时,核心特点:
- 多平台支持 - WhatsApp、Telegram、飞书、Discord 等
- 工具扩展 - 文件操作、网页搜索、浏览器自动化等
- 本地部署 - 数据完全掌控,支持私有模型
- 技能系统 - 模块化扩展,自定义工作流
- Node.js: 24+ 推荐(22 LTS 也支持)
- 系统: macOS、Linux 或 Windows(WSL2)
- 内存: 最低 1GB,推荐 2GB+
- 存储: 约 500MB(不含模型)
检查 Node 版本:
1
2
node –version
# 应显示 v22.16+ 或 v24+
macOS / Linux:
1
curl -fsSL https://openclaw.ai/install.sh | bash
Windows (PowerShell):
1
iwr -useb https://openclaw.ai/install.ps1 | iex
安装脚本会自动:
- 检测并安装合适的 Node.js 版本
- 安装 OpenClaw CLI
- 启动配置向导
如果已管理 Node.js 环境:
1
2
npm install -g openclaw@latest
openclaw onboard –install-daemon
注意: 如果遇到
sharp构建错误(macOS 常见),使用: 1
2
3
4
5
6
7
8
9
10
11
12
13SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latestbash
方式三:Docker 部署
适合服务器或隔离环境:
bash
docker run -d
–name openclaw
-p 18789:18789
-v openclaw-data:/root/.openclaw
openclaw/openclaw:latest
访问 http://localhost:18789 查看控制面板。
安装完成后,运行配置向导:
1
openclaw onboard –install-daemon
向导会引导你完成:
- 选择 AI 模型 - 支持 OpenAI、Anthropic、智谱、通义千问等
- 配置认证 - 输入 API Key
- 选择渠道 - WhatsApp、Telegram、飞书等(可跳过)
- 安装服务 - 将 Gateway 注册为系统服务
提供商 模型 特点 智谱 AI glm-4 中文优秀,性价比高 通义千问 qwen-plus 长文本处理好 OpenAI gpt-4o 综合能力最强 Anthropic claude-3.5 代码能力强
1
openclaw gateway status
正常输出应显示服务运行中。
1
openclaw dashboard
或访问 http://127.0.0.1:18789/
在控制面板中,你可以:
- 直接对话测试
- 查看会话历史
- 配置模型和渠道
- 管理技能和工具
如果配置了渠道(如飞书):
1
2
3
openclaw message send
–target "用户 ID"
–message "Hello from OpenClaw"
- 创建飞书应用:https://open.feishu.cn/app
- 获取 App ID 和 App Secret
- 配置回调 URL:
https://你的域名/openclaw/feishu - 添加到配置文件:
1
openclaw config edit
添加配置:
1
2
3
4
channels:
feishu:
appId: cli_xxxxxxxxxxxxx
appSecret: xxxxxxxxxxxxxxx
- 运行:
openclaw channels whatsapp setup - 扫描二维码绑定
- 完成配置
- 联系 @BotFather 创建机器人
- 获取 Token
- 配置:
openclaw channels telegram add
OpenClaw 支持技能扩展,例如:
1
ls ~/.openclaw/workspace/skills/
直接在聊天中说明需求:
- “帮我写一篇技术博客” → 使用
hexo-blogger技能 - “检查天气” → 使用
weather技能 - “搜索 GitHub issues” → 使用
gh-issues技能
参考官方文档:技能创建指南
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 查看状态
openclaw status
openclaw gateway status
# 重启服务
openclaw gateway restart
# 查看日志
openclaw gateway logs
# 更新版本
openclaw update
# 打开配置
openclaw config edit
# 查看帮助
openclaw –help
1
2
3
4
5
6
7
8
# 查看详细日志
openclaw gateway logs --follow
# 检查端口占用
lsof -i :18789
# 手动前台运行测试
openclaw gateway --port 18789
- 检查 API Key 是否正确
- 验证网络连接
- 查看配额限制
1
2
# 测试模型连接
openclaw models test
- 检查渠道是否启用
- 验证回调 URL 配置
- 查看渠道日志
1
export OPENCLAW_HOME=/path/to/your/workspace
- 配置:
/.openclaw/config.json - 工作区:
/.openclaw/workspace/ - 日志:
~/.openclaw/logs/
变量 说明
OPENCLAW_HOME 自定义根目录
OPENCLAW_STATE_DIR 状态目录
OPENCLAW_CONFIG_PATH 配置文件路径
- 📚 官方文档
- 💬 Discord 社区
- 🛠️ 技能中心
- 🔧 自定义工具开发
参考信息:
- 当前版本:OpenClaw 2026.3.13
- Node.js 版本:v24.10.0
- 文档更新日期:2026-03-21
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/248288.html