A complete guide to running your AI agent on a DigitalOcean Droplet. 15 minutes from zero to live agent.
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
# Install OpenClaw globally
npm install -g openclaw
# Initialize workspace
openclaw init
# This creates:
# ~/.openclaw/config.yaml
# ~/.openclaw/workspace/
Edit your config file:
nano ~/.openclaw/config.yaml
Add your API keys and Telegram bot token. See full config reference.
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
Send a message to your Telegram bot. If everything is configured correctly, your AI agent will respond. Check logs with:
journalctl -u openclaw -f
If you want to access the OpenClaw dashboard via a custom domain:
apt install caddyAffiliate link