Deploy OpenClaw on a VPS

Run the self-hosted OpenClaw AI agent 24/7 on a cloud Virtual Private Server. This hub covers why to use a VPS, which provider to choose (AWS, DigitalOcean, Linode, Hetzner), shared prerequisites and workflow, and links to step-by-step guides for each provider. Typical cost is about $6–24/month for a small instance; OpenClaw itself is free and open-source.

📘 Quick path: If you already have a Linux server (any VPS), use the Quick Start Guide to install OpenClaw in minutes. This page helps you pick a VPS provider and points you to provider-specific setup (firewall, SSH, systemd, security).

1. Why Deploy OpenClaw on a VPS?

OpenClaw is an autonomous AI agent that can run tasks, connect to WhatsApp, Telegram, Discord, Slack, and 15+ messaging platforms, and work 24/7. Running it on a VPS (Virtual Private Server) gives you:

  • 24/7 availability - Your agent stays online even when your laptop or home PC is off.
  • Stable IP and environment - No sleep modes or network changes that can break channel connections.
  • Predictable cost - Most providers charge a fixed monthly fee ($6–24 for entry tiers); you add LLM API usage (Anthropic, OpenAI, etc.) or use Ollama for local models.
  • Data control - Your conversations and data stay on your server; see security best practices and OpenClaw vs ChatGPT for privacy comparison.

Alternatives to a raw VPS include Docker on a VPS (same machine, containerized) or Raspberry Pi for low-cost home hosting. For a full overview of installation options, see the Installation hub.

2. What OpenClaw Needs on a VPS

Before choosing a provider, ensure your plan meets these requirements (aligned with the official install docs):

  • Node.js 22+ - Required by OpenClaw. Install via your distro’s package manager or nodejs.org.
  • OS: Ubuntu 22.04 LTS (recommended), Debian, or other Linux. Avoid end-of-life distros.
  • RAM: At least 1 GB for light use; 2 GB or more recommended for production, multiple channels, or heavier ClawHub skills.
  • Storage: A few GB is usually enough; more if you keep large logs or local models.
  • Network: Outbound internet for messaging APIs and LLM providers (Anthropic, OpenAI, etc.).

You will also need an LLM API key (e.g. Anthropic Claude, OpenAI, DeepSeek) and optionally an account for your first channel (Telegram, Discord, WhatsApp).

3. VPS Provider Comparison & Guides

Below are the most common VPS providers used for OpenClaw, with links to our step-by-step deployment guides. Pricing and specs are indicative; check each provider’s site for current plans. For a fuller comparison, see VPS provider comparison for OpenClaw and the cost calculator.

Provider Starting price (approx.) Entry-tier RAM / vCPU Our step-by-step guide
AWS EC2 Free tier (t3.micro) or ~$8–15/mo 1 GB / 1 vCPU (t3.micro) Deploy OpenClaw on AWS EC2
DigitalOcean ~$6/mo (Basic Droplet) 1 GB / 1 vCPU Deploy OpenClaw on DigitalOcean
Linode ~$5–12/mo 1–2 GB / 1 vCPU Deploy OpenClaw on Linode
Hetzner ~€4–7/mo 2 GB / 1 vCPU Deploy OpenClaw on Hetzner

Each guide covers: creating the instance (Ubuntu 22.04 recommended), SSH access, installing Node.js 22+ and OpenClaw (one-line installer or npm), running OpenClaw as a systemd service for 24/7 operation, and firewall/security so the OpenClaw gateway port is never exposed to the internet.

4. General VPS Deployment Workflow

Regardless of provider, the workflow is similar:

  1. Provision - Create a Linux instance (Ubuntu 22.04 LTS recommended), add your SSH key, choose a region close to you or your users.
  2. Firewall - Allow only SSH (port 22) from your IP. Do not open the OpenClaw gateway port (1618) to the public. The gateway should bind to 127.0.0.1; access the dashboard or CLI via SSH port forwarding, Tailscale, or another VPN. See network isolation and security best practices.
  3. Connect via SSH - e.g. ssh root@YOUR_SERVER_IP (or a non-root user if configured).
  4. Install Node.js 22+ - Use your distro’s package manager or NodeSource; verify with node -v.
  5. Install OpenClaw - Run the one-line installer: curl -fsSL https://openclaw.ai/install.sh | bash, or npm install -g openclaw.
  6. Run onboarding - Run openclaw to complete the wizard (LLM provider, first channel).
  7. Run as a service - Use systemd (or similar) so OpenClaw restarts on reboot and runs in the background. Each provider guide includes a systemd unit example.

After deployment, follow post-installation setup and the security checklist.

5. Common VPS Deployment Issues

Issue Solution
SSH connection failed Check security group/firewall allows SSH (22) from your IP; verify key and username (root vs ubuntu).
Node version too old OpenClaw requires Node.js 22+. Install from NodeSource or nodejs.org; run node -v.
Gateway not reachable Never expose port 1618 publicly. Use SSH port forwarding (ssh -L 1618:127.0.0.1:1618 user@server) or Tailscale/VPN to access the dashboard.
Out of memory (OOM) On 1 GB plans, add swap; or upgrade to 2 GB. See provider-specific guides for swap setup.
Channel or API errors Verify API keys and channel credentials; check troubleshooting guide and channel errors.

For more fixes, see the full troubleshooting hub and installation errors section.

6. Best Practices

  • Bind gateway to localhost only - Do not expose the OpenClaw gateway port (1618) to the internet. Use SSH tunneling, Tailscale, or a VPN for remote access.
  • Apply security best practices: firewall (UFW or provider firewall), strong SSH (key-only if possible), and keep the system updated.
  • Store API keys and secrets in environment variables or a secrets manager; avoid hardcoding. See credential management.
  • Run OpenClaw as a systemd service so it restarts on reboot and is easy to manage (systemctl status openclaw).
  • Regularly update OpenClaw (npm update -g openclaw or re-run the installer) and the OS (apt update && apt upgrade).

7. Next Steps

8. Related Resources