Host OpenClaw on a DigitalOcean Droplet
Learn how to run a persistent OpenClaw Gateway on a DigitalOcean Droplet. This guide covers prerequisites, droplet creation, and installation steps.
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 (around $6/month for the 1 GB Basic plan).
DigitalOcean is a simple paid VPS option. For cheaper or free alternatives:
- Hetzner -- better core and RAM value per dollar.
- Oracle Cloud -- Always Free ARM tier (up to 4 OCPU, 24 GB RAM), but signup can be tricky and it only supports ARM.
Prerequisites
- DigitalOcean account (signup)
- SSH key pair (or you can use password authentication)
- Roughly 20 minutes
Setup
Create a Droplet
Warning
Start from a clean base image (Ubuntu 24.04 LTS). Do not use third-party Marketplace 1-click images unless you have checked their startup scripts and firewall defaults.
- Sign in to DigitalOcean.
- Select Create > Droplets.
- Configure:
- Region: Nearest to you
- Image: Ubuntu 24.04 LTS
- Size: Basic, Regular, 1 vCPU / 1 GB RAM / 25 GB SSD
- Authentication: SSH key (preferred) or password
- Click Create Droplet and record the IP address.
Connect and install
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
# 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
Only use the root shell for system bootstrap. Run OpenClaw commands 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 authentication, channel setup, gateway token generation, and daemon installation (as a systemd user service).
Add swap (recommended for 1 GB Droplets)
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab
Verify the gateway
openclaw status
systemctl --user status openclaw-gateway.service
journalctl --user -u openclaw-gateway.service -f
Access the Control UI
The gateway binds to loopback by default. Choose one of these approaches.
Option A: SSH tunnel (easiest)
# From your local machine
ssh -L 18789:localhost:18789 root@YOUR_DROPLET_IP
Then 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
Then open https://<magicdns>/ from any device on your tailnet.
Tailscale Serve authenticates Control UI and WebSocket traffic using tailnet identity headers, which assumes the gateway host itself is trusted. HTTP API endpoints still follow the gateway's normal auth mode (token or password) regardless. To require explicit shared-secret credentials over Serve, set gateway.auth.allowTailscale: false and use gateway.auth.mode: "token" or "password".
Option C: Tailnet bind (no Serve)
openclaw config set gateway.bind tailnet
openclaw gateway restart
Then open http://<tailscale-ip>:18789 (token required).
Persistence and backups
OpenClaw state lives under:
~/.openclaw/--openclaw.json, channel and provider credentials, per-agentauth-profiles.json, and session data.~/.openclaw/workspace/-- the agent workspace (SOUL.md, memory, artifacts).
These survive Droplet reboots. To take a portable snapshot:
openclaw backup create
DigitalOcean snapshots back up the entire Droplet; openclaw backup create is portable across hosts.
1 GB RAM tips
The $6 Droplet has only 1 GB RAM. To keep things running smoothly:
- Ensure the swap step above is in
/etc/fstabso it persists across reboots. - Prefer API-based models (Claude, GPT) over local ones. Local LLM inference does not fit in 1 GB.
- Set
agents.defaults.model.primaryto a smaller model if you hit OOM errors on large prompts. - Monitor with
free -handhtop.
Troubleshooting
Gateway will not start -- Run openclaw doctor --non-interactive and check logs with journalctl --user -u openclaw-gateway.service -n 50.
Port already in use -- Run lsof -i :18789 to locate the process, then stop it.
Out of memory -- Verify swap is active with free -h. If you still hit OOM, switch to API-based models (Claude, GPT) instead of local models, or upgrade to a 2 GB Droplet.
Next steps
- Channels -- connect Telegram, WhatsApp, Discord, and more
- Gateway configuration -- all config options
- Updating -- keep OpenClaw up to date