Skip to content

DigitalOcean

在 DigitalOcean Droplet 上執行持久化的 OpenClaw Gateway。

  • DigitalOcean 帳戶(註冊
  • SSH 金鑰對(或願意使用密碼驗證)
  • 大約 20 分鐘
  1. 建立 Droplet

    1. 登入 DigitalOcean
    2. 點擊 Create > Droplets
    3. 選擇:
      • Region: 離您最近的區域
      • Image: Ubuntu 24.04 LTS
      • Size: Basic, Regular, 1 vCPU / 1 GB RAM / 25 GB SSD
      • Authentication: SSH 金鑰(建議)或密碼
    4. 點擊 Create Droplet 並記下 IP 位址。
  2. 連線並安裝

    Terminal window
    ssh root@YOUR_DROPLET_IP
    apt update && apt upgrade -y
    # Install Node.js 24
    curl -fsSL https://deb.nodesource.com/setup_24.x | bash -
    apt install -y nodejs
    # Install OpenClaw
    curl -fsSL https://openclaw.ai/install.sh | bash
    openclaw --version
  3. 執行入門設定

    Terminal window
    openclaw onboard --install-daemon

    精靈會引導您完成模型驗證、通道設定、Gateway 權杖產生及常駐程式安裝(systemd)。

  4. 新增 swap(建議用於 1 GB Droplet)

    Terminal window
    fallocate -l 2G /swapfile
    chmod 600 /swapfile
    mkswap /swapfile
    swapon /swapfile
    echo '/swapfile none swap sw 0 0' >> /etc/fstab
  5. 驗證閘道

    bash openclaw status systemctl --user status openclaw-gateway.service journalctl --user -u openclaw-gateway.service -f

  6. 存取控制 UI

    Gateway 預設會綁定到 loopback。請選擇其中一個選項。

    選項 A:SSH tunnel(最簡單)

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

    然後開啟 http://localhost:18789

    選項 B:Tailscale Serve

    Terminal window
    curl -fsSL https://tailscale.com/install.sh | sh
    tailscale up
    openclaw config set gateway.tailscale.mode serve
    openclaw gateway restart

    然後從您 tailnet 上的任何裝置開啟 `https://

    /`。

    **選項 C:Tailnet bind(無 Serve)**
    ```bash
    openclaw config set gateway.bind tailnet
    openclaw gateway restart
    ```
    然後開啟 `http://

    :18789`(需要權杖)。

Gateway 無法啟動 — 執行 openclaw doctor --non-interactive 並使用 journalctl --user -u openclaw-gateway.service -n 50 檢查日誌。

連接埠已被使用 — 執行 lsof -i :18789 尋找程序,然後將其停止。

記憶體不足 — 使用 free -h 驗證 swap 是否已啟用。如果仍然遇到 OOM,請使用基於 API 的模型(Claude、GPT)而不是本地模型,或者升級到 2 GB 的 Droplet。

  • 頻道 — 連接 Telegram、WhatsApp、Discord 等
  • Gateway 設定 — 所有設定選項
  • 更新 — 保持 OpenClaw 為最新版本