🌊 DigitalOcean Tutorial

Deploy OpenClaw on DigitalOcean

A complete guide to running your AI agent on a DigitalOcean Droplet. 15 minutes from zero to live agent.

Step 1: Create a Droplet

  1. Log in to DigitalOcean
  2. Click Create → Droplets
  3. Choose Ubuntu 24.04 LTS
  4. Select plan: Basic → Regular → $12/mo (2 GB RAM) or $24/mo (4 GB RAM) for more headroom
  5. Choose a datacenter region close to you
  6. Add your SSH key (or use password auth)
  7. Click Create Droplet

Step 2: Connect and Set Up

SSH into your new server:

ssh root@your-droplet-ip

Install Node.js 22 LTS:

# Install Node.js via NodeSource
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs

# Verify
node --version  # Should show v22.x.x
npm --version

Step 3: Install OpenClaw

# Install OpenClaw globally
npm install -g openclaw

# Initialize workspace
openclaw init

# This creates:
# ~/.openclaw/config.yaml
# ~/.openclaw/workspace/

Step 4: Configure Models & Channels

Edit your config file:

nano ~/.openclaw/config.yaml

Add your API keys and Telegram bot token. See full config reference.

Step 5: Start as a Service

Create a systemd service so OpenClaw starts on boot and restarts on crash:

cat > /etc/systemd/system/openclaw.service << 'EOF'
[Unit]
Description=OpenClaw AI Agent Gateway
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/openclaw gateway start --foreground
Restart=always
RestartSec=5
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target
EOF

systemctl enable openclaw
systemctl start openclaw
systemctl status openclaw

Step 6: Verify

Send a message to your Telegram bot. If everything is configured correctly, your AI agent will respond. Check logs with:

journalctl -u openclaw -f

Optional: Set Up a Domain

If you want to access the OpenClaw dashboard via a custom domain:

  1. Point your domain's A record to your Droplet IP
  2. Install Caddy for automatic HTTPS: apt install caddy
  3. Configure Caddy to reverse proxy to port 3333
💡 Save money?

Hostinger VPS offers 2x the specs at half the price

8 GB RAM + 100 GB NVMe at just $5.99/mo vs DigitalOcean's 4 GB at $24/mo
Compare Hostinger →

Affiliate link

Looking at other options?