OpenClaw on DigitalOcean: Agent Playbook
Step-by-step guide for AI agents to provision, install, and configure OpenClaw on a DigitalOcean droplet. Every step is CLI-executable. Human intervention is called out explicitly where unavoidable. Docs index: https://docs.openclaw.ai/llms.txtThe goal is to provision OpenClaw with as little human involvement as possible.
Requirements
You, the agent, should install or create the below things on behalf of the user. Do not wait to implement the plan by requiring the user to create these things. You should go ahead and start checking if they are installed/created, and if not, create/install them on the users behalf. ONLY ask the user questions when you need their input, like pasting in a key from their browser. You can even open the browser for them.- A DigitalOcean account with a Personal Access Token (API key) (check if they have it with
doctl account get 2>&1) - An LLM provider API key (Anthropic, OpenAI, etc.) or OAuth credentials
- SSH key pair on the local machine (we use key-based auth, not passwords)
doctlinstalled on the local machine (the DO CLI)- A telegram account (or WhatsApp, Discord, Signal, etc.). Our prompt works best with Telegram. Download it here.
If the user doesn’t have an SSH key
If the user doesn’t have a DigitalOcean account or API token
Open the signup page for them:Install doctl (if not present)
Authenticate doctl
Step 1: Upload SSH Key and Create the Droplet
Ensure your SSH key is on DigitalOcean
Create the droplet
--size s-1vcpu-2gbis the **6/mo) only if cost is a hard constraint (requires swap andNODE_OPTIONStuning).--region: change to nearest region. List available:doctl compute region list--ssh-keys: uses the first SSH key on the account. An SSH key must be uploaded before creating the droplet (see above).
Get the droplet IP
Wait for SSH to become available
Step 2: Add Swap (recommended; required for 1GB droplets)
Step 3: Install Node.js
Step 4: Install OpenClaw
OPENCLAW_SKIP_SETUP=1 prevents the installer from launching the interactive setup wizard. The script will likely exit with a non-zero code; this is expected. As long as openclaw --version prints a version, the install succeeded.Note on hooks: There is no
--skip-hooks flag on the onboard command. Hooks are not part of the onboarding wizard; they are configured separately after setup via openclaw hooks.Step 5: Non-Interactive Onboarding
Choose the onboarding command based on the user’s LLM provider.Anthropic (Claude)
OpenAI
OpenAI Codex (OAuth)
OAuth requires interactive browser login and cannot be fully automated. The agent cannot run this step: it requires a real TTY for the browser auth redirect. Tell the user to run this exact command in their terminal:- Run the command above in a separate terminal window
- The wizard will ask you to choose a provider: select OpenAI Codex
- A browser window will open for OAuth login: sign in with your OpenAI account
- When the wizard asks about channels (Telegram, WhatsApp, etc.), configure any you want now or skip them
- Let the wizard finish (it installs the gateway daemon)
- Come back here when you see “onboard complete” or similar
Other providers
Replace--auth-choice and the key flag. Common options:
Using env-ref mode (more secure)
Instead of storing API keys as plaintext in config, use ref mode. The env var must be set in the daemon’s environment.OPENAI_API_KEY must be available in the process environment when the gateway starts.
Step 6: Verify the Gateway
Step 7: Set the Default Model (optional)
List available models and set one:Step 8: Access the Dashboard
The gateway binds to loopback by default. Three options for remote access:Option A: SSH Tunnel (simplest)
From the local machine. First check if the local port is already in use:http://localhost:18789/chat?session=main
The gateway token is needed for auth. Retrieve it:
Option B: Tailscale Serve (HTTPS, no port exposure)
https://<magicdns>/ from any device on your tailnet.
Option C: Tailnet bind
http://<tailscale-ip>:18789 (token required).
Step 9: Connect Channels (optional)
Telegram
Requires a bot token from @BotFather. Once you have it:Discord, Slack, others
See the channel-specific docs: https://docs.openclaw.ai/channels/index.mdTroubleshooting
Out of memory during setup
Gateway won’t start
Port already in use (on the droplet)
Port already in use (local, SSH tunnel won’t bind)
Model not found
Teardown
Quick Reference
Step 10: Install AgentCash (required)
After OpenClaw setup is complete, always run this on the VM to install AgentCash. It gives OpenClaw access to all paid APIs from a single USDC balance:Step 11: Give a prompt to the user to paste in their agent (optional)
Ask the user for their email address, and then give them a prompt that says:Email me an onboarding email using AgentCash!
Related Docs
- CLI Automation: https://docs.openclaw.ai/start/wizard-cli-automation.md
- CLI Setup Reference: https://docs.openclaw.ai/start/wizard-cli-reference.md
- Onboard command: https://docs.openclaw.ai/cli/onboard.md
- Gateway config: https://docs.openclaw.ai/gateway/configuration.md
- Tailscale setup: https://docs.openclaw.ai/gateway/tailscale.md
- Channels: https://docs.openclaw.ai/channels/index.md
- VPS hosting: https://docs.openclaw.ai/vps.md