Linux 系统安装 OpenClaw 并接入 QQ 机器人
系统准备
环境要求
- 操作系统:Debian 12(其他 Linux 发行版类似)
- 用户权限:root 用户
- 网络:可正常访问外部网络
SSH 配置(可选)
如需通过 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
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.1:APT 镜像源配置完成]
安装 Node.js
OpenClaw 基于 Node.js 开发,需要安装 Node.js 20:
# 安装 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
source "$HOME/.nvm/nvm.sh"
# 安装 Node.js 20
nvm install 20
# 启用 pnpm
corepack enable pnpm
# 验证安装
node -v
[图 1.2:Node.js 安装成功]
安装 OpenClaw
一键安装
使用官方安装脚本:
curl -fsSL https://openclaw.ai/install.sh | bash
[图 2.1:OpenClaw 安装过程]
[图 2.2:选择 YES]
[图 2.3:快速引导]


