Deploy OpenClaw on DigitalOcean Droplet

Run a persistent OpenClaw Gateway on a DigitalOcean Droplet for about $6 per month. This guide covers prerequisites, droplet creation, and setup for a basic Ubuntu 24.04 VPS.

Read this when

  • Setting up OpenClaw on DigitalOcean
  • Looking for a simple paid VPS for OpenClaw

Run a persistent OpenClaw Gateway on a DigitalOcean Droplet (about $6/month on the 1 GB Basic plan).

DigitalOcean offers a straightforward paid VPS route. If you'd rather spend less or nothing:

  • Hetzner -- better value on cores and RAM per dollar.
  • Oracle Cloud -- Always Free ARM tier (up to 4 OCPU, 24 GB RAM), though signup can be troublesome and it only supports ARM.

Prerequisites

  • A DigitalOcean account (sign up here)
  • An SSH key pair (or you can fall back to password authentication)
  • Around 20 minutes of your time

Setup

Create a Droplet

Warning

Start from a clean base image (Ubuntu 24.04 LTS). Skip third-party Marketplace 1-click images unless you've already inspected their startup scripts and firewall defaults.

  1. Sign in to DigitalOcean.
  2. Select Create > Droplets.
  3. Configure:
    • Region: Pick the one nearest you
    • Image: Ubuntu 24.04 LTS
    • Size: Basic, Regular, 1 vCPU / 1 GB RAM / 25 GB SSD
    • Authentication: SSH key (preferred) or password
  4. Hit Create Droplet and write down the IP address.

Connect and install

ssh root@YOUR_DROPLET_IP

apt update && apt upgrade -y

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

# Install OpenClaw; run onboarding later as the non-root owner.
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard

# Create the non-root user that will own OpenClaw state and services.
adduser openclaw
usermod -aG sudo openclaw
loginctl enable-linger openclaw

su - openclaw
openclaw --version

Limit the root shell to system bootstrap duties. All OpenClaw commands should run as the non-root openclaw user, so state stays under /home/openclaw/.openclaw/ and the Gateway installs as that user's systemd --user service.

Run onboarding

openclaw onboard --install-daemon

The wizard handles model auth, channel setup, gateway token generation, and daemon installation (systemd user service) step by step.

Add swap (recommended for 1 GB Droplets)

sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Verify the gateway

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

Access the Control UI

By default the gateway listens only on loopback. Choose one of these approaches.

Option A: SSH tunnel (easiest)

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

After that, open http://localhost:18789.

Option B: Tailscale Serve

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

Now open https://<magicdns>/ from any device connected to your tailnet.

Tailscale Serve relies on tailnet identity headers to authenticate Control UI and WebSocket traffic, which presumes the gateway host itself is trusted. HTTP API endpoints keep using the gateway's standard auth mode (token/password) no matter what. If you want explicit shared-secret credentials over Serve, configure gateway.auth.allowTailscale: false and use gateway.auth.mode: "token" or "password".

Persistence and backups

OpenClaw state is stored in:

  • ~/.openclaw/ -- openclaw.json, channel/provider credentials, per-agent auth-profiles.json, and session data.
  • ~/.openclaw/workspace/ -- the agent workspace (SOUL.md, memory, artifacts).

These persist across Droplet reboots. For a portable snapshot:

openclaw backup create
openclaw backup restore <archive.tar.gz> --target <fresh-directory>

DigitalOcean snapshots capture the entire Droplet; openclaw backup create works across hosts. Restore verifies and unpacks into a fresh staging directory, with activation as a separate offline step. Check Restore a full archive for rollback warnings and the activation sequence.

1 GB RAM tips

The $6 Droplet comes with just 1 GB RAM. To keep performance acceptable:

  • Ensure the swap step above is included in /etc/fstab so it persists across reboots.
  • Favor API-based models (Claude, GPT) over local ones, since local LLM inference won't fit in 1 GB.
  • Set agents.defaults.model.primary to a smaller model if large prompts trigger OOM errors.
  • Keep an eye on things with free -h and htop.

Troubleshooting

Gateway fails to start -- Run openclaw doctor --non-interactive and inspect logs with journalctl --user -u openclaw-gateway.service -n 50.

Port already taken -- Use lsof -i :18789 to locate the process and terminate it.

Out of memory -- Confirm swap is active with free -h. If OOMs persist, switch to API-based models (Claude, GPT) instead of local ones, or move up to a 2 GB Droplet.

Next steps

765 words · updated Aug 25, 2026