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-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 镜像源配置完成
1.3 安装 Node.js
OpenClaw 基于 Node.js 开发,需要安装 Node.js 24:
apt install curl -y
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
.
nvm install 24
corepack pnpm
node -v
















