Platform setup

How to Set Up OpenClaw on DigitalOcean

4 min read

Browse more in Platform setup.

All platform setup guides →

This guide walks you through how to set up OpenClaw on a DigitalOcean Droplet and keep it running as a persistent gateway. js 24 and OpenClaw, then wire up the Control UI over SSH or Tailscale.

By the end, you have a production-style OpenClaw Gateway on DigitalOcean with a systemd daemon and swap configured for a 1 GB Droplet.

Setup flow

Prerequisites

  • A DigitalOcean account (signup at https://cloud.digitalocean.com/registrations/new).
  • An SSH key pair, or willingness to use password authentication for the Droplet.
  • About 20 minutes to provision the Droplet, install OpenClaw, and verify the gateway.

Steps

  1. 1

    Create a DigitalOcean Droplet for OpenClaw

    04 LTS Droplet so you control exactly what runs on the box and avoid surprise firewall or startup scripts from Marketplace images. The basic 1 vCPU / 1 GB / 25 GB SSD plan works for a small gateway, but you should add swap later to avoid OOM issues.

    text
    Log into DigitalOcean.
    Click Create > Droplets.
    Choose:
      Region: Closest to you
      Image: Ubuntu 24.04 LTS
      Size: Basic, Regular, 1 vCPU / 1 GB RAM / 25 GB SSD
      Authentication: SSH key (recommended) or password
    Click Create Droplet and note the IP address.
  2. 2

    Connect to the Droplet and install Node.js 24 and OpenClaw

    js 24 from NodeSource so OpenClaw runs on a supported runtime. After that you run the official OpenClaw installer script and confirm the CLI is on the PATH.

    bash
    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. 3

    Run the OpenClaw onboarding wizard and install the daemon

    Use the onboarding command to configure models, channels, and gateway auth in one pass, and to install the systemd user service that keeps the gateway running. Let the wizard generate the gateway token and write config so you do not have to hand-edit files on first boot.

    bash
    openclaw onboard --install-daemon
  4. 4

    Add swap space for 1 GB Droplets

    js do not crash under memory pressure. This sequence creates a 2G swapfile, enables it immediately, and persists it across reboots via /etc/fstab.

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

    Verify the OpenClaw gateway service

    Before exposing anything, confirm the gateway daemon is healthy. Use the OpenClaw CLI to check status, then inspect the systemd user service and follow logs so you can catch config or auth issues early.

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

    Access the Control UI over SSH or Tailscale

    By default the gateway binds to loopback, so you need a tunnel or Tailscale to reach the Control UI from your laptop. Pick SSH port forwarding for a quick one-off, or Tailscale Serve / tailnet bind if you want ongoing access from multiple devices.

    bash
    # Option A: SSH tunnel (simplest)
    # From your local machine
    ssh -L 18789:localhost:18789 root@YOUR_DROPLET_IP
    
    # Option B: Tailscale Serve
    curl -fsSL https://tailscale.com/install.sh | sh
    tailscale up
    openclaw config set gateway.tailscale.mode serve
    openclaw gateway restart
    
    # Option C: Tailnet bind (no Serve)
    openclaw config set gateway.bind tailnet
    openclaw gateway restart

Configuration

OptionDescriptionExample
gateway.tailscale.modeControls how the gateway exposes its Control UI over Tailscale; set to serve to use Tailscale Serve.serve
gateway.bindChanges the bind interface for the gateway; set to tailnet to bind directly to the Tailscale tailnet.tailnet

Troubleshooting

Gateway will not start

Run the OpenClaw doctor in non-interactive mode to scan for common issues, then inspect the systemd user logs for the gateway service to see the exact failure. This helps you catch missing model auth, bad config, or runtime errors instead of guessing.

bash
openclaw doctor --non-interactive
journalctl --user -u openclaw-gateway.service -n 50

Port already in use when binding to 18789

If the Control UI port is already taken, find the conflicting process with lsof and stop or reconfigure it before restarting the gateway. This avoids silent failures where OpenClaw starts but cannot bind to the expected port.

bash
lsof -i :18789

Out of memory on a 1 GB Droplet

First confirm swap is active so the kernel has breathing room; if you still hit OOM, switch to API-based models like Claude or GPT instead of local models, or resize the Droplet to at least 2 GB RAM.

bash
free -h

Frequently asked questions

Powered by Mem0

Add persistent memory to OpenClaw

Official Mem0 plugin for OpenClaw keeps context across chats and tools. Smaller prompts, lower cost, better continuity for your agents.

More in Platform setup