How to Run OpenClaw on a $5/Month VPS (Complete Setup Guide)

“`html

Looking to get a VPS for your project? Vultr offers reliable VPS hosting starting at $5/month with global data centers. Many OpenClaw users self-host on Vultr for consistent uptime and affordable pricing.

\n

Affiliate Disclosure: As an Amazon Associate, we earn from qualifying purchases. This means we may earn a small commission when you click our links and make a purchase on Amazon. This comes at no extra cost to you and helps support our site.

\n

How to Run OpenClaw on a $5/Month VPS: Complete Setup Guide

\n

I’ve been running OpenClaw instances on budget VPS providers for months now, and I’ve learned exactly what works and what doesn’t. In this guide, I’m sharing the exact steps I use to get OpenClaw running reliably on a $5/month Hetzner or DigitalOcean droplet, including how to expose your gateway, connect Telegram, and fix the common errors that trip up most people.

\n

Why Run OpenClaw on a VPS?

\n

Running OpenClaw on your local machine is fine for testing, but you’ll hit limits immediately. A cheap VPS gives you persistent uptime, real bandwidth, and the ability to run your bot 24/7 without touching your home connection. I’ve found that the minimal specs ($5/month) are genuinely sufficient for OpenClaw—it’s lightweight enough that you won’t need more unless you’re scaling to multiple concurrent instances.

\n

Choosing Your VPS Provider

\n

Both Hetzner and DigitalOcean have reliable $5/month offerings:

\n

    \n

  • Hetzner Cloud: 1GB RAM, 1 vCPU, 25GB SSD. Slightly better value, multiple datacenters.
  • \n

  • DigitalOcean: 512MB RAM, 1 vCPU, 20GB SSD. Good uptime, excellent documentation.
  • \n

\n

I prefer Hetzner for the extra RAM, but either works. For this guide, I’m using Ubuntu 22.04 LTS—it’s stable, widely supported, and plays nicely with Node.js.

\n

Step 1: Initial VPS Setup

\n

Once you’ve spun up your droplet, SSH in immediately and harden the basics:

\n

ssh root@your_vps_ip\napt update && apt upgrade -y\napt install -y curl wget git build-essential\n

\n

Set up a non-root user (highly recommended):

\n

adduser openclaw\nusermod -aG sudo openclaw\nsu - openclaw\n

\n

From here on, work as the openclaw user. This protects your system if something goes wrong with the OpenClaw process.

\n

Step 2: Install Node.js

\n

OpenClaw requires Node.js 16 or higher. I use NodeSource’s repository for stable, up-to-date builds:

\n

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -\nsudo apt-get install -y nodejs\nnode --version\nnpm --version\n

\n

You should see Node.js 18.x and npm 9.x or higher. Verify npm works correctly:

\n

npm config get registry\n

\n

This should output https://registry.npmjs.org/. If it doesn’t, your npm is misconfigured.

\n

Step 3: Clone and Install OpenClaw

\n

Create a directory for your OpenClaw instance and clone the repository:

\n

mkdir -p ~/openclaw && cd ~/openclaw\ngit clone https://github.com/openclawresource/openclaw.git .\n

\n

Install dependencies. This is where most people encounter their first errors—be patient:

\n

npm install\n

\n

If you hit permission errors on the npm cache, try:

\n

npm cache clean --force\nnpm install\n

\n

Verify the installation completed by checking for the node_modules directory:

\n

ls -la node_modules | head -20\n

\n

You should see dozens of packages. If node_modules is empty or missing, npm install didn’t complete successfully.

\n

Step 4: Configure OpenClaw Environment

\n

OpenClaw needs configuration before it runs. Create a .env file in your openclaw directory:

\n

cd ~/openclaw\nnano .env\n

\n

Here’s a minimal working configuration:

\n

NODE_ENV=production\nOPENCLAW_PORT=3000\nOPENCLAW_HOST=0.0.0.0\nOPENCLAW_BIND_ADDRESS=0.0.0.0:3000\n\n# Gateway settings (we'll expose this externally)\nGATEWAY_HOST=0.0.0.0\nGATEWAY_PORT=8080\n\n# Telegram Bot (add after creating bot)\nTELEGRAM_BOT_TOKEN=your_token_here\nTELEGRAM_WEBHOOK_URL=https://your_domain_or_ip:8080/telegram\n\n# Security\nBOOTSTRAP_TOKEN=generate_a_strong_random_token_here\nJWT_SECRET=another_random_token_here\n

\n

Generate secure tokens using OpenSSL:

\n

openssl rand -base64 32\n

\n

Run this twice and paste the output into BOOTSTRAP_TOKEN and JWT_SECRET respectively. Save the .env file (Ctrl+X, Y, Enter in nano).

\n

Critical: Fixing gateway.bind Errors

\n

The most common error at this stage is gateway.bind: error EACCES or similar. This happens because ports below 1024 require root privileges. Never run OpenClaw as root. Instead, use higher ports in your .env and proxy traffic through Nginx (covered in Step 6).

\n

Verify your .env is correctly formatted:

\n

grep "GATEWAY_PORT\\|OPENCLAW_PORT" ~/.env\n

\n

Both should be 8080 or higher for non-root operation.

\n

Step 5: Test OpenClaw Locally

\n

Before exposing anything to the internet, test that OpenClaw starts:

\n

cd ~/openclaw\nnpm start\n

\n

Watch the logs carefully. You should see something like:

\n

[2024-01-15T10:23:45.123Z] info: OpenClaw Gateway listening on 0.0.0.0:8080\n[2024-01-15T10:23:46.456Z] info: Bootstrap token initialized\n

\n

If you see bootstrap token expired immediately, your BOOTSTRAP_TOKEN is malformed or your system clock is wrong. Check:

\n

date -u\n

\n

The output should be reasonable (current date/time). If it’s decades off, your VPS has clock drift. Stop OpenClaw (Ctrl+C) and fix it:

\n

sudo timedatectl set-ntp on\n

\n

Then restart OpenClaw. In 99% of cases, this solves the bootstrap token expired error.

\n

Once OpenClaw is running, verify it’s actually listening:

\n

curl http://localhost:8080/health\n

\n

You should get a 200 response (or a JSON response). If you get connection refused, OpenClaw didn’t start properly. Check the logs for the actual error message.

\n

Stop OpenClaw with Ctrl+C and move to the next step.

\n

Step 6: Expose OpenClaw with Nginx Reverse Proxy

\n

Your VPS needs an external domain or IP to work with Telegram and external tools. Install Nginx:

\n

sudo apt install -y nginx\n

\n

Create an Nginx config. If you have a domain, use that. If not, use your VPS IP (less ideal, but functional):

\n

sudo nano /etc/nginx/sites-available/openclaw\n

\n

Paste this configuration:

\n

upstream openclaw_gateway {\n    server 127.0.0.1:8080;\n}\n\nserver {\n    listen 80;\n    server_name your_domain_or_ip;\n\n    location / {\n        proxy_pass http://openclaw_gateway;\n        proxy_http_version 1.1;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection 'upgrade';\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n        proxy_cache_bypass $http_upgrade;\n    }\n}\n

\n

Enable the site and test Nginx:

\n

sudo ln -s /etc/nginx/sites-available/openclaw /etc/nginx/sites-enabled/\nsudo nginx -t\nsudo systemctl restart nginx\n

\n

If Nginx test returns “successful,” you’re good. Now test externally:

\n

curl http://your_vps_ip/health\n

\n

You should get the same response as before. Congratulations—OpenClaw is now exposed on port 80.

\n

Optional: HTTPS with Let’s Encrypt

\n

For production, HTTPS is essential. If you have a real domain:

\n

sudo apt install -y certbot python3-certbot-nginx\nsudo certbot --nginx -d your_domain.com\n

\n

Certbot modifies your Nginx config automatically and handles renewal. If you’re using just an IP, HTTPS won’t work (browsers reject self-signed certs for IPs), but HTTP is sufficient for testing.

\n

Step 7: Connect Your Telegram Bot

\n

Create a Telegram bot via BotFather if you haven’t already (@BotFather on Telegram). You’ll get a token like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11.

\n

Update your .env with the token and webhook URL:

\n

TELEGRAM_BOT_TOKEN=your_actual_token\nTELEGRAM_WEBHOOK_URL=http://your_vps_ip/telegram\n

\n

Start OpenClaw again in the background using a process manager. Install PM2:

\n

npm install -g pm2\npm2 start npm --name openclaw -- start\npm2 startup\npm2 save\n

\n

This ensures OpenClaw restarts if the VPS reboots or the process crashes.

\n

Verify the Telegram integration by sending a test message to your bot on Telegram. Check logs with:

\n

pm2 logs openclaw\n

\n

You should see the message logged. If you see unauthorized errors, your TELEGRAM_BOT_TOKEN is wrong or malformed. Double-check it against BotFather’s output.

\n

Troubleshooting Common Errors

\n

gateway.bind: error EACCES

\n

Ports below 1024 need root. Use ports 1024+ in .env and proxy through Nginx (as shown in Step 6).

\n

bootstrap token expired

\n

Fix your system clock:

\n

sudo timedatectl set-ntp on\ndate -u\n

\n

unauthorized (Telegram or other auth)

\n

Verify your tokens in .env are exactly correct with no trailing spaces:

\n

cat ~/.env | grep TOKEN\n

\n

Compare character-by-character with your original token from BotFather.

\n

npm install fails with permission errors

\n

npm cache clean --force\nsudo chown -R openclaw:openclaw ~/openclaw\nnpm install\n

\n

Monitoring and Maintenance

\n

Once running, keep an eye on your VPS health:

\n

free -h  # Check RAM usage\ndf -h    # Check disk space\npm2 status  # Check if OpenClaw is running\npm2 logs openclaw --lines 50  # View recent logs\n

\n

I recommend setting up log rotation so your logs don’t consume all disk space:

\n

pm2 install pm2-logrotate\n

\n

Next Steps

\n

With OpenClaw running on your VPS, explore the additional configuration options available on openclawresource.com. The platform supports webhooks, custom handlers, and integration with dozens of services. Start simple—get the basics working first—then expand from there.

\n

Questions? Double-check your .env, verify your tokens, and check system logs. Most issues resolve once you understand where to look.

\n

? Get the OpenClaw Automation Starter Kit ($29) →

\n

Frequently Asked Questions

\n

\n

\n

What is OpenClaw and why run it on a $5/month VPS?

\n

OpenClaw is an open-source framework for solving hyperbolic PDEs, used in scientific simulations. Running it on a budget VPS offers an affordable, dedicated, and accessible environment for computations without needing powerful local hardware.

\n

\n

\n

What are the minimum VPS specifications needed for this guide?

\n

For a $5/month VPS, aim for at least 1-2 vCPU, 1-2 GB RAM, and 25-50 GB SSD storage. While more resources improve performance, this guide focuses on making it accessible and cost-effective.

\n

\n

\n

Is this guide suitable for users new to VPS or OpenClaw?

\n

Yes, this is a “Complete Setup Guide” designed for step-by-step implementation. While some basic command-line comfort helps, it aims to be comprehensive enough for users new to VPS administration or OpenClaw deployment.

\n

\n

\n

Want to see what OpenClaw can really do? Check out this wild project building AI agents with physical bodies →

Not sure which AI agent to use? OpenClaw vs Nanobot vs Open Interpreter — full comparison →

Related: OpenClaw on a Mac Mini: Complete Setup Guide 2026

Related: OpenClaw Telegram Setup: Complete Guide

Related: OpenClaw on a Mac Mini: Complete Setup Guide 2026

Related: OpenClaw Telegram Setup: Complete Guide

Related: OpenClaw on a Mac Mini: Complete Setup Guide 2026

Related: OpenClaw Telegram Setup: Complete Guide