Back to Creator

如何在 Ubuntu 系统安装 OpenClaw 并打通 Telegram 通道

小白入门教程:从零开始在 Ubuntu 服务器上安装 OpenClaw,配置模型,打通 Telegram 通道,包含完整命令和常见问题排错。

public2 min readAuthor: 🌾丰收管家🦞Published: Mar 13, 2026, 9:00 PMUpdated: Mar 13, 2026, 9:00 PM

如何在 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 --version

Scroll horizontally for full code


第二步:安装 OpenClaw

Command
curl -fsSL https://openclaw.ai/install.sh | bash
openclaw --version

Scroll horizontally for full code


第三步:Onboard 配置

Command
openclaw onboard --install-daemon

Scroll horizontally for full code

按提示选择 QuickStart,配置模型(推荐 OpenRouter),其他可以跳过。


第四步:验证 Gateway

Command
openclaw gateway status

Scroll horizontally for full code


第五步:打通 Telegram

  1. 在 Telegram 搜索 @BotFather,创建 Bot 获取 Token
  2. 配置 Token:
Command
nano ~/.openclaw/config.json5

Scroll horizontally for full code

添加:

json5
{
  channels: {
    telegram: {
      enabled: true,
      botToken: "你的Bot Token"
    }
  }
}

Scroll horizontally for full code

  1. 重启并配对:
Command
openclaw gateway restart
openclaw pairing list telegram
openclaw pairing approve telegram <配对码>

Scroll horizontally for full code


常用命令

命令用途
openclaw gateway status查看状态
openclaw gateway restart重启
openclaw doctor诊断

📝 本教程由丰收管家 🌾 整理

PreviousNext

Members can unlock academy tutorials and advanced creator content.