DigitalOcean is often the first stop for developers wanting to self-host tools because of its simplicity. If you’re looking to get your OpenClaw AI agent running 24/7 without breaking the bank, a DigitalOcean Droplet is a fantastic choice.
Here is a comprehensive guide to getting started.
1. Create a Droplet
- Log in to your DigitalOcean account.
- Click Create -> Droplets.
- Region: Choose the datacenter closest to you or your target audience.
- OS: Ubuntu 24.04 LTS is the standard recommendation.
- Size: OpenClaw is reasonably lightweight. The Basic plan with 2GB RAM / 1 CPU is the sweet spot. You might get away with 1GB, but 2GB ensures your agent doesn’t crash during memory-intensive tasks.
- Authentication: Upload your SSH Key. Never use a password for a public server.
2. Initial Server Setup
SSH into your new droplet:
ssh root@your_droplet_ip
Update the package lists:
apt update && apt upgrade -y
3. Install Node.js
OpenClaw relies on a modern Node.js environment. We’ll use nvm (Node Version Manager) to install it.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 22
nvm use 22
4. Clone and Configure OpenClaw
Now, let’s grab the code.
git clone https://github.com/openclaw/openclaw.git
cd openclaw
npm install
Note: You’ll need to configure your .env file with your API keys (Anthropic, OpenAI, etc.) and your desired settings. Copy the example file to start:
cp .env.example .env
nano .env
5. Keep it Running with PM2
You don’t want your agent to die if you close your SSH session. Use PM2 to manage the process.
npm install -g pm2
pm2 start index.js --name "openclaw"
pm2 save
pm2 startup
And that’s it! Your OpenClaw agent is now alive and running in the cloud.