在 Linux 上把 OpenClaw 接到 QQ 机器人
这套流程我按 Debian 12 走了一遍,前半段是把系统和 Node.js 环境铺好,后半段是把 OpenClaw 接到 QQ 机器人。OpenClaw 本身依赖 Node.js 24,模型这边用的是华为云 MaaS。
系统准备
环境要求
- 操作系统:Debian 12(其他 Linux 发行版思路差不多)
- 用户权限:root 用户
- 网络:能正常访问外网
SSH 配置(可选)
如果要远程登录,先把 root 密码登录打开:
vi /etc/ssh/sshd_config
把相关项改成:
PasswordAuthentication yes PermitRootLogin yes
然后重启 SSH:
systemctl restart sshd
配置 APT 镜像源
国内网络下,先把源换掉,后面装包会省很多时间。可以直接跑自动化脚本,也可以手动写清华源:
# 方法一:使用自动化脚本
bash <(curl -sSL https://linuxmirrors.cn/main.sh)
# 方法二:手动配置清华源
cat > /etc/apt/sources.list <<EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
EOF
apt update

图 1.1:APT 镜像源配置完成
安装 Node.js
OpenClaw 基于 Node.js,官方安装脚本默认会按它的要求来,所以先把 Node.js 24 装好:
















