VPS Hosting
在虚拟专用服务器上部署 OpenClaw
VPS Hosting
在虚拟专用服务器上部署 OpenClaw。
推荐提供商
| 提供商 | 起价 | 优点 | 缺点 |
|---|---|---|---|
| Hetzner | €5/月 | 便宜、欧洲、性能好 | 仅限欧洲 |
| DigitalOcean | $6/月 | 全球、简单、文档好 | 较贵 |
| Linode | $5/月 | 全球、性能好 | 支持一般 |
| Vultr | $6/月 | 全球、高频率实例 | 较贵 |
| Oracle Cloud | 免费层 | 永久免费 | 资源有限 |
系统要求
| 要求 | 最小 | 推荐 |
|---|---|---|
| CPU | 1 核心 | 2 核心 |
| RAM | 1 GB | 2 GB |
| 磁盘 | 10 GB | 20 GB |
| 系统 | Ubuntu 20.04+ | Ubuntu 22.04 LTS |
快速部署
# 1. SSH 到服务器
ssh user@your-vps-ip
# 2. 更新系统
sudo apt update && sudo apt upgrade -y
# 3. 安装 OpenClaw
curl -fsSL https://openclaw.ai/install.sh | bash
# 4. 配置防火墙
sudo ufw allow 22/tcp # SSH
sudo ufw allow 41641/udp # Tailscale(如使用)
sudo ufw enable
# 5. 运行配置向导
openclaw onboard
安全加固
1. 禁用 root 登录
# 编辑 SSH 配置
sudo nano /etc/ssh/sshd_config
# 修改以下行
PermitRootLogin no
PasswordAuthentication no
# 重启 SSH
sudo systemctl restart sshd
2. 设置 fail2ban
# 安装
sudo apt install fail2ban -y
# 启动
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
3. 配置 Tailscale
# 安装 Tailscale
curl -fsSL https://tailscale.com/install.sh | sh
# 连接
sudo tailscale up
# 验证
tailscale status
监控
使用 systemd
# 检查状态
sudo systemctl status openclaw
# 查看日志
sudo journalctl -u openclaw -f
# 重启服务
sudo systemctl restart openclaw
云平台部署指南
Fly.io
全球分布,~$2/月
Hetzner
欧洲,€4.51/月
GCP
Google Cloud,~$26/月
Railway
简单部署,$5/月
Render
免费层可用,$7/月
Northflank
欧洲合规,$5/月