Linux 从零开始:将 OpenClaw 接入 QQ 机器人
本指南提供完整的 OpenClaw 安装和 QQ 机器人接入流程,适用于 Debian 12 系统,模型使用华为云 MaaS。
系统准备
环境要求
- 操作系统:Debian 12(其他 Linux 发行版类似)
- 用户权限:root 用户
- 网络:可正常访问外部网络
1.1 SSH 配置(可选)
如需通过 SSH 远程管理,可配置 root 密码登录:
vi /etc/ssh/sshd_config
修改以下配置:
PasswordAuthentication yes PermitRootLogin yes
重启 SSH 服务:
systemctl restart sshd
1.2 配置 APT 镜像源
使用国内镜像源加速软件下载:
# 方法一:使用自动化脚本
bash <(curl -sSL https://linuxmirrors.cn/main.sh)
# 方法二:手动配置清华源
cat > /etc/apt/sources.list <<EOF
deb 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 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
EOF
apt update
1.3 安装 Node.js
OpenClaw 基于 Node.js 开发,需要安装 Node.js 24:
# 安装 curl(如果未安装)
apt install curl -y
# 安装 nvm(Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
# 加载 nvm
. "$HOME/.nvm/nvm.sh"
# 安装 Node.js 24
nvm install 24
# 启用 pnpm corepack enablepnpm
# 验证安装
node -v
安装 OpenClaw
2.1 一键安装
使用官方安装脚本:
curl -fsSL https://openclaw.ai/install.sh | bash


