前言
本文介绍如何在 Linux 服务器上全新安装 OpenClaw,包含 Node.js 环境配置、OpenClaw 安装、飞书/Telegram 频道配置等完整步骤。
环境要求
- Ubuntu / Debian 系统
- Node.js 22.x
- Git
- 网络可访问飞书/Telegram(国内服务器可能需要代理)
第一步:安装 Node.js 22
添加 NodeSource 仓库
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
安装 Node.js
sudo apt install -y nodejs
验证版本
node -v
第二步:安装 Git
更新软件包
sudo apt update
安装 Git
sudo apt install git -y
验证安装
git --version
第三步:更换 npm 国内镜像(可选)
国内服务器建议使用镜像加速:
npm config set registry https://registry.npmmirror.com
第四步:安装 OpenClaw
全局安装
sudo npm install -g openclaw@latest
验证安装
openclaw --version
第五步:配置模型
执行配置向导
openclaw config
按提示选择:
- 选 Local (this machine)
- 选 Model → Continue
- 选 MiniMax(或其他提供商)
立即体验 MiniMax M2.7,使用 专属订阅链接 购买 Token Plan,享 9 折优惠。
- 输入 API Key
- 选择模型(如 MiniMax-M2.7)
- 保存后重启网关
第六步:安装 Gateway 服务
安装 Gateway 服务
openclaw gateway install
启动 Gateway
openclaw gateway start
设置开机自启
systemctl --user enable openclaw-gateway.service
查看状态
openclaw status
第七步:配置飞书频道
方法一:交互式配置
openclaw config
选择:
- Local (this machine)
- Channels → Continue
- Feishu
- 输入 App ID 和 App Secret
- 保存后重启网关
方法二:命令行快速配置
openclaw config set channels.feishu.enabled true
openclaw config set channels.feishu.appId "your-app-id"
openclaw config set channels.feishu.appSecret "your-app-secret"
重启网关
openclaw gateway restart
第八步:配置 Telegram 频道
启用 Telegram
openclaw config set channels.telegram.enabled true
设置 Bot Token
openclaw config set channels.telegram.botToken "your-bot-token"
设置 DM 策略
openclaw config set channels.telegram.dmPolicy open
设置允许来自
openclaw config set channels.telegram.allowFrom '["*"]'
重启网关
systemctl --user restart openclaw-gateway.service
第九步:配对认证
在飞书或 Telegram 收到配对码后,在终端执行批准。
飞书配对
openclaw pairing approve feishu <配对码>
Telegram 配对
openclaw pairing approve telegram <配对码>
验证安装
查看网关状态
openclaw status
查看飞书状态
openclaw status | grep Feishu
查看 Telegram 状态
openclaw status | grep Telegram
查看实时日志
openclaw logs --follow
设置主模型
设置 MiniMax-M2.7 为主模型
openclaw models set minimax/MiniMax-M2.7
设置高速模型
openclaw models set minimax/MiniMax-M2.7-highspeed
重启网关使配置生效
openclaw gateway restart
评论 (0)
暂无评论