Files
Moltbot/docs/zh-CN/platforms/digitalocean.md
Seb Slight c18452598a docs: restructure Get Started tab and improve onboarding flow (#9950)
* docs: restructure Get Started tab and improve onboarding flow

- Flatten nested Onboarding group into linear First Steps flow
- Add 'What is OpenClaw?' narrative section to landing page
- Split wizard.md into streamlined overview + full reference (reference/wizard.md)
- Move Pairing to Channels > Configuration
- Move Bootstrapping to Agents > Fundamentals
- Move macOS app onboarding to Platforms > macOS companion app
- Move Lore to Help > Community
- Remove duplicate install instructions from openclaw.md
- Mirror navigation changes in zh-CN tabs
- No content deleted — all detail preserved or relocated

* docs: move deployment pages to install/, fix Platforms tab routing, clarify onboarding paths

- Move deployment guides (fly, hetzner, gcp, macos-vm, exe-dev, railway, render,
  northflank) from platforms/ and root to install/
- Add 'Hosting and deployment' group to Install tab
- Slim Gateway & Ops 'Remote access and deployment' down to 'Remote access'
- Swap Platforms tab before Gateway & Ops to fix path-prefix routing
- Move macOS app onboarding into First steps (parallel to CLI wizard)
- Rename sidebar titles to 'Onboarding: CLI' / 'Onboarding: macOS App'
- Add redirects for all moved paths
- Update all internal links (en + zh-CN)
- Fix img tag syntax in onboarding.md
2026-02-05 17:45:01 -05:00

6.4 KiB
Raw Blame History

read_when, summary, title, x-i18n
read_when summary title x-i18n
在 DigitalOcean 上设置 OpenClaw
寻找便宜的 VPS 托管来运行 OpenClaw
在 DigitalOcean 上运行 OpenClaw简单的付费 VPS 选项) DigitalOcean
generated_at model provider source_hash source_path workflow
2026-02-03T07:51:55Z claude-opus-4-5 pi d60559b8751da37413e5364e83c88254b476b2283386a0b07b2ca6b4e16157fc platforms/digitalocean.md 15

在 DigitalOcean 上运行 OpenClaw

目标

$6/月(或使用预留定价 $4/月)在 DigitalOcean 上运行持久的 OpenClaw Gateway 网关。

如果你想要 $0/月的选项且不介意 ARM + 特定提供商的设置,请参阅 Oracle Cloud 指南

成本比较2026

提供商 方案 配置 价格/月 备注
Oracle Cloud Always Free ARM 最高 4 OCPU、24GB RAM $0 ARM容量有限 / 注册有坑
Hetzner CX22 2 vCPU、4GB RAM €3.79 (~$4) 最便宜的付费选项
DigitalOcean Basic 1 vCPU、1GB RAM $6 界面简单,文档完善
Vultr Cloud Compute 1 vCPU、1GB RAM $6 多地区可选
Linode Nanode 1 vCPU、1GB RAM $5 现为 Akamai 旗下

选择提供商:

  • DigitalOcean最简单的用户体验 + 可预测的设置(本指南)
  • Hetzner性价比高参见 Hetzner 指南
  • Oracle Cloud可以 $0/月,但更麻烦且仅限 ARM参见 Oracle 指南

前提条件

1) 创建 Droplet

  1. 登录 DigitalOcean
  2. 点击 Create → Droplets
  3. 选择:
    • Region 离你(或你的用户)最近的地区
    • Image Ubuntu 24.04 LTS
    • Size Basic → Regular → $6/mo1 vCPU、1GB RAM、25GB SSD
    • Authentication SSH 密钥(推荐)或密码
  4. 点击 Create Droplet
  5. 记下 IP 地址

2) 通过 SSH 连接

ssh root@YOUR_DROPLET_IP

3) 安装 OpenClaw

# Update system
apt update && apt upgrade -y

# Install Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt install -y nodejs

# Install OpenClaw
curl -fsSL https://openclaw.ai/install.sh | bash

# Verify
openclaw --version

4) 运行新手引导

openclaw onboard --install-daemon

向导将引导你完成:

  • 模型认证API 密钥或 OAuth
  • 渠道设置Telegram、WhatsApp、Discord 等)
  • Gateway 网关令牌(自动生成)
  • 守护进程安装systemd

5) 验证 Gateway 网关

# Check status
openclaw status

# Check service
systemctl --user status openclaw-gateway.service

# View logs
journalctl --user -u openclaw-gateway.service -f

6) 访问控制面板

Gateway 网关默认绑定到 loopback。要访问控制界面

选项 ASSH 隧道(推荐)

# From your local machine
ssh -L 18789:localhost:18789 root@YOUR_DROPLET_IP

# Then open: http://localhost:18789

选项 BTailscale ServeHTTPS仅 loopback

# On the droplet
curl -fsSL https://tailscale.com/install.sh | sh
tailscale up

# Configure Gateway to use Tailscale Serve
openclaw config set gateway.tailscale.mode serve
openclaw gateway restart

打开:https://<magicdns>/

注意事项:

  • Serve 保持 Gateway 网关仅 loopback 并通过 Tailscale 身份头进行认证。
  • 要改为需要令牌/密码,请设置 gateway.auth.allowTailscale: false 或使用 gateway.auth.mode: "password"

选项 CTailnet 绑定(不使用 Serve

openclaw config set gateway.bind tailnet
openclaw gateway restart

打开:http://<tailscale-ip>:18789(需要令牌)。

7) 连接你的渠道

Telegram

openclaw pairing list telegram
openclaw pairing approve telegram <CODE>

WhatsApp

openclaw channels login whatsapp
# Scan QR code

参见渠道了解其他提供商。


1GB RAM 的优化

$6 的 droplet 只有 1GB RAM。为了保持运行流畅

添加 swap推荐

fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab

使用更轻量的模型

如果遇到 OOM考虑

  • 使用基于 API 的模型Claude、GPT而不是本地模型
  • agents.defaults.model.primary 设置为更小的模型

监控内存

free -h
htop

持久化

所有状态存储在:

  • ~/.openclaw/ — 配置、凭证、会话数据
  • ~/.openclaw/workspace/ — 工作区SOUL.md、记忆等

这些在重启后保留。定期备份:

tar -czvf openclaw-backup.tar.gz ~/.openclaw ~/.openclaw/workspace

Oracle Cloud 免费替代方案

Oracle Cloud 提供 Always Free ARM 实例,比这里任何付费选项都强大得多 — 每月 $0。

你将获得 配置
4 OCPUs ARM Ampere A1
24GB RAM 绰绰有余
200GB 存储 块存储卷
永久免费 不收取信用卡费用

注意事项:

  • 注册可能有点麻烦(失败了就重试)
  • ARM 架构 — 大多数东西都能工作,但有些二进制文件需要 ARM 构建

完整设置指南请参阅 Oracle Cloud。关于注册技巧和注册流程故障排除,请参阅此社区指南


故障排除

Gateway 网关无法启动

openclaw gateway status
openclaw doctor --non-interactive
journalctl -u openclaw --no-pager -n 50

端口已被使用

lsof -i :18789
kill <PID>

内存不足

# Check memory
free -h

# Add more swap
# Or upgrade to $12/mo droplet (2GB RAM)

另请参阅