最近 OpenClaw 火了,很多小伙伴想在自己的服务器上部署一个专属的 AI 助手。今天就来详细讲讲 OpenClawd(OpenClaw 守护进程)的完整部署流程,从零开始,包教包会!🎉
一、OpenClawd 是什么?
OpenClawd 是 OpenClaw 的后台守护进程,负责:
- 消息处理 - 接收和发送 WhatsApp、Telegram、Discord 等消息
- 任务调度 - 管理定时任务、提醒事项
- 网关管理 - 维护各平台连接状态
- 会话管理 - 处理多会话、子代理运行
简单说,有了 OpenClawd,你的 AI 助手就能 24 小时在线,随时响应消息!💪
二、系统要求
最低配置
- CPU: 1 核
- 内存:512MB(推荐 1GB+)
- 存储:1GB 可用空间
- 系统:Linux (Ubuntu 20.04+ / Debian 10+ / CentOS 8+)
推荐配置
- CPU: 2 核+
- 内存:2GB+
- 存储:5GB+
- 系统:Ubuntu 22.04 LTS
必需软件
- Node.js 18+ (推荐 20+)
- Git
- PM2 (进程管理)
三、安装 Node.js
Ubuntu/Debian
# 使用 NodeSource 源安装 Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
sudo apt install -y nodejs
# 验证安装
node -v
npm -v
使用 NVM(推荐)
# 安装 NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
# 安装 Node.js 20
nvm install 20
nvm use 20
nvm alias default 20
四、安装 OpenClaw
NPM 安装(推荐)
# 全局安装 OpenClaw
sudo npm install -g openclaw
# 验证安装
openclaw --version
openclaw help
五、初始化配置
# 创建工作目录
mkdir -p ~/openclaw-workspace
cd ~/openclaw-workspace
# 初始化 OpenClaw
openclaw init
六、配置消息渠道
Telegram Bot(最简单)
- 在 Telegram 搜索 @BotFather
- 发送 /newbot 创建新机器人
- 获取 Bot Token
- 配置到 OpenClaw
# 启动网关
openclaw gateway start
# 手机扫描二维码配对
七、启动 OpenClawd(PM2 管理)
# 安装 PM2
sudo npm install -g pm2
# 启动 OpenClawd
pm2 start openclaw --name openclawd
# 设置开机自启
pm2 startup
pm2 save
# 查看状态
pm2 status
pm2 logs openclawd
八、验证运行状态
# 检查进程
pm2 status
ps aux | grep openclaw
# 查看日志
pm2 logs openclawd --lines 50
# 检查端口
netstat -tulpn | grep 8080
九、常用 PM2 命令
pm2 status # 查看状态
pm2 logs openclawd # 查看日志
pm2 restart openclawd # 重启
pm2 stop openclawd # 停止
pm2 monit # 监控
十、故障排查
无法启动
pm2 logs openclawd --err
# 检查端口、Node.js 版本、依赖
内存过高
pm2 restart openclawd --max-memory-restart 500M
十一、安全建议
- 配置防火墙(UFW/iptables)
- 使用反向代理(Nginx)
- 保护 Token 和配置文件
- 定期更新密码
写在最后
部署完成后,你的专属 AI 助手就 24 小时在线啦!🎉
后续可以配置更多渠道、添加自定义技能、设置定时任务等。
官方文档:docs.openclaw.ai
社区 Discord:discord.gg/clawd
祝大家部署顺利!🚀
文章评论