更新和维护
🔄 保支持最新:定期更新 OpenClaw 以获得新功能和安全修复。
检查更新
bash
# 检查当前版本
openclaw --version
# 检查最新版本
curl -s https://api.github.com/repos/openclaw/openclaw/releases/latest | grep tag_name本地安装更新
bash
# 方式一:使用安装脚本
curl -fsSL https://openclaw.ai/install.sh | bash
# 方式二:手动更新
cd ~/openclaw
git pull origin main
pnpm install
pnpm buildDocker 更新
bash
# 拉取最新镜像
docker pull openclaw/openclaw:latest
# 停止并删除旧内容器
docker stop openclaw
docker rm openclaw
# 启动新内容器
docker run -d \
--name openclaw \
-p 18789:18789 \
-v ~/.openclaw:/root/.openclaw \
--restart unless-stopped \
openclaw/openclaw:latest备份数据
本地安装备份:
bash
# 备份配置和数据
tar -czf openclaw-backup-$(date +%Y%m%d).tar.gz ~/.openclaw
# 恢复数据
tar -xzf openclaw-backup-20260210.tar.gz -C ~/Docker 备份:
bash
# 备份数据卷
docker run --rm \
-v ~/.openclaw:/data \
-v $(pwd):/backup \
alpine tar czf /backup/openclaw-backup-$(date +%Y%m%d).tar.gz /data
# 恢复数据
docker run --rm \
-v ~/.openclaw:/data \
-v $(pwd):/backup \
alpine tar xzf /backup/openclaw-backup-20260210.tar.gz -C /监控和日志
查看日志:
bash
# 本地安装
tail -f ~/.openclaw/logs/gateway.log
# Docker
docker logs -f openclaw监控指标:
bash
# 查看系统状态
openclaw gateway status
# 查看资源使用
openclaw stats
# 查看 API 消耗和额度
openclaw status --usage故障排查
常见访问题:
Gateway 无法启动
bash# 查看日志 openclaw logs # 检查端口占用 lsof -i :18789 # 重启 Gateway openclaw gateway restartAPI 连接失败
bash# 测试 API 连接 openclaw test api # 检查 API Key openclaw config get models.providers性能访问题
bash# 清理缓存 openclaw cache clear # 重启服务 openclaw gateway restart
卸载
本地安装卸载:
bash
# 停止服务
openclaw gateway stop
# 删除文件
rm -rf ~/.openclaw
rm -rf ~/openclaw
# 删除命令
npm uninstall -g openclawDocker 卸载:
bash
# 停止并删除内容器
docker stop openclaw
docker rm openclaw
# 删除镜像
docker rmi openclaw/openclaw
# 删除数据
rm -rf ~/.openclaw