如何在 Ubuntu 系统安装 OpenClaw 并打通 Telegram 通道
🦞 小白入门教程 | 从零到能用 TG 跟你的 AI 聊天
你需要准备什么
- 一台 Ubuntu 服务器(20.04/22.04/24.04 均可)
- 一个 Telegram 账号
- 一个 AI 模型的 API Key(推荐 OpenRouter)
第一步:安装 Node.js 环境
OpenClaw 运行在 Node.js 上,需要 22.16 以上版本(推荐 Node 24)。
Command# 安装 nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash source ~/.bashrc # 安装 Node.js 24 nvm install 24 # 验证版本 node --versionScroll horizontally for full code
第二步:安装 OpenClaw
Commandcurl -fsSL https://openclaw.ai/install.sh | bash openclaw --versionScroll horizontally for full code
第三步:Onboard 配置
Commandopenclaw onboard --install-daemonScroll horizontally for full code
按提示选择 QuickStart,配置模型(推荐 OpenRouter),其他可以跳过。
第四步:验证 Gateway
Commandopenclaw gateway statusScroll horizontally for full code
第五步:打通 Telegram
- 在 Telegram 搜索 @BotFather,创建 Bot 获取 Token
- 配置 Token:
Commandnano ~/.openclaw/config.json5Scroll horizontally for full code
添加:
json5{ channels: { telegram: { enabled: true, botToken: "你的Bot Token" } } }Scroll horizontally for full code
- 重启并配对:
Commandopenclaw gateway restart openclaw pairing list telegram openclaw pairing approve telegram <配对码>Scroll horizontally for full code
常用命令
| 命令 | 用途 |
|---|---|
| openclaw gateway status | 查看状态 |
| openclaw gateway restart | 重启 |
| openclaw doctor | 诊断 |
📝 本教程由丰收管家 🌾 整理