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'
# 默认注释了源码镜像以提高 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.3 安装 Node.js
OpenClaw 基于 Node.js 开发,需要安装 Node.js 24:
# 安装 curl(如果未安装)
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


