How to Run OpenClaw 24/7: The Ultimate VPS Deployment Guide
Learn how to deploy OpenClaw on a cheap cloud server (DigitalOcean/Vultr) so it runs 24/7 without keeping your computer on.
Running OpenClaw on your local laptop is great for testing, but what if you want your agent to work while you sleep? Or what if you don't want to burn through your battery life?
The solution is to deploy OpenClaw to a VPS (Virtual Private Server).
Transparency Note: This guide contains affiliate links. If you sign up using our links, you get free credits to try the service, and we may earn a commission to support this site.
Why Use a VPS?
Instead of keeping your Mac Mini or Gaming PC running all night, a Cloud Server offers:
- 24/7 Uptime: Your agent never sleeps.
- Clean Network: Cloud providers have stable, high-speed internet connections.
- Cost Effective: It costs less than the electricity bill of a high-end PC.
- Safety: If the agent goes rogue, it's isolated on a remote server, not your personal computer.
Recommended Providers & Configuration
For running a Node.js-based AI agent like OpenClaw, we recommend a server with at least 2 vCPUs and 4GB RAM to handle the runtime and network requests smoothly.
🏆 Top Choice: DigitalOcean (Best for Beginners)
DigitalOcean is famous for its simplicity. We have secured a special deal for OpenClaw users:
👉 Click here to get $200 Free Credit on DigitalOcean
(Valid for 60 days. Enough to run a powerful server for free for 2 months!)
🥈 Runner Up: Vultr
Great performance and supports crypto payments/Alipay.
👉 Click here to get $100 Free Credit on Vultr
Step-by-Step Deployment Guide
In this guide, we will use DigitalOcean and Ubuntu 22.04 LTS. The steps are almost identical for Vultr.
Step 1: Create Your Server (Droplet)
- Sign up using the Free $200 Link.
- Click Create -> Droplets.
- Choose Region: Select a data center close to you (e.g., San Francisco, New York, or London).
- Choose Image: Select Ubuntu 22.04 (LTS).
- Choose Size:
- Select Basic.
- CPU Option: Regular (Intel with SSD).
- Price: We recommend the $24/mo (4GB RAM / 2 CPUs) plan for production.
- Budget Tip: You can try the $6/mo plan for testing, but Node.js might be slow.
- Authentication: Choose Password (easiest) or SSH Key (most secure).
- Click Create Droplet.
Step 2: Connect to Your Server
Wait for the green dot to appear. Copy the IP Address (e.g., 192.168.1.1).
Open your terminal (Mac/Linux) or PowerShell (Windows) and type:
ssh root@<your-ip-address>
# Example: ssh root@159.203.12.45Type yes to accept the fingerprint, then enter the password you created.
Step 3: Install the Environment
Now you are inside the Linux server. Run these commands one by one to set up the environment.
1. Update the System:
apt update && apt upgrade -y2. Install Node.js (Using NVM):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 18
nvm use 183. Install Git:
apt install git -yStep 4: Install OpenClaw
This is similar to your local installation, but on the cloud.
# 1. Clone the repo
git clone https://github.com/OpenClaw/OpenClaw.git
cd OpenClaw
# 2. Install dependencies
npm install
# 3. Configure API Keys
cp .env.example .env
nano .envInside the nano editor, paste your OPENAI_API_KEY or ANTHROPIC_API_KEY.
(Press Ctrl+O then Enter to save, and Ctrl+X to exit).
Step 5: Run 24/7 with PM2 (Crucial Step!) 🌟
If you just run npm start, the bot will stop when you close the SSH window. We need a Process Manager to keep it alive forever.
We will use PM2.
1. Install PM2 globally:
npm install pm2 -g2. Start OpenClaw with PM2:
pm2 start npm --name "OpenClaw" -- run start3. Save the process list:
This ensures OpenClaw restarts automatically if the server reboots.
pm2 save
pm2 startup(Copy and paste the command output by pm2 startup if asked).
Verification
Your OpenClaw is now running in the background!
View Logs: To see what your bot is doing (or check for errors):
pm2 logs OpenClawStop Bot:
pm2 stop OpenClawAccess Dashboard:
Open your browser and type http://<your-server-ip>:3000.
Security Tip: Firewall Setup
By default, your server might expose too many ports. It is good practice to enable a firewall (UFW).
ufw allow 22/tcp # Allow SSH (Important!)
ufw allow 3000/tcp # Allow OpenClaw Dashboard
ufw enableSummary
You now have a fully autonomous AI agent running 24/7 on the cloud.
- Need to update? Just run
git pullandpm2 restart OpenClaw. - Server costs too much? Destroy the Droplet when you aren't using it (Data will be lost).
👉 Ready to deploy? Get your $200 DigitalOcean Credit here