VPS Hosting

在虚拟专用服务器上部署 OpenClaw

VPS Hosting

在虚拟专用服务器上部署 OpenClaw。

推荐提供商

提供商起价优点缺点
Hetzner€5/月便宜、欧洲、性能好仅限欧洲
DigitalOcean$6/月全球、简单、文档好较贵
Linode$5/月全球、性能好支持一般
Vultr$6/月全球、高频率实例较贵
Oracle Cloud免费层永久免费资源有限

系统要求

要求最小推荐
CPU1 核心2 核心
RAM1 GB2 GB
磁盘10 GB20 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

云平台部署指南

相关文档

  • Docker - Docker 容器化部署
  • Ansible - Ansible 自动化部署
  • 安全 - 安全加固指南