← Back to Knowledge Base

How to Set Up OpenClaw on a VPS — Your 24/7 AI Agent

Fri Mar 06 2026

What is OpenClaw?

OpenClaw is an open-source AI agent that runs on your own hardware. Unlike browser-based chatbots that only respond when you ask, OpenClaw actively executes tasks: managing your calendar, handling emails, running shell commands, browsing the web, and automating workflows — all while keeping your data private.

With over 269,000 GitHub stars and 300,000+ active users since its January 2026 launch, it has quickly become the go-to self-hosted AI assistant. It connects to WhatsApp, Telegram, Slack, Discord, Signal, iMessage, Teams, and 15+ other platforms, so you can control your AI from anywhere.

Why Run OpenClaw on a VPS Instead of Your Computer?

You can run OpenClaw on your laptop, but a VPS gives you significant advantages:

What Can OpenClaw Do?

Choosing the Right VPS

OpenClaw is lightweight. If you're connecting to cloud AI APIs (OpenAI, Claude, etc.), even a basic VPS works. If you plan to run local models with Ollama, you'll need more resources.

Minimum Requirements

Recommended VPS Providers

Provider Best For Starting Price
BandwagonHost Reliable infrastructure, the company behind Just My Socks $49.99/year
Vultr Hourly billing, global locations, easy scaling $6/month
RackNerd Best value for long-term use, low annual pricing ~$23/year
Contabo High RAM configs for local models, European servers €4.99/month
Kamatera Custom configurations, enterprise-grade reliability $4/month
DigitalOcean Developer-friendly, excellent documentation $6/month

Step-by-Step Installation

1. Connect to Your VPS

ssh root@YOUR_VPS_IP

2. Update the System

apt update && apt upgrade -y

3. Install Node.js 22

curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt install -y nodejs

Verify the installation:

node -v   # Should show v22.x.x

4. Install OpenClaw

curl -fsSL https://openclaws.io/install.sh | bash

5. Run the Setup Wizard

openclaw onboard

The wizard will walk you through:

6. Start the Gateway

openclaw gateway start

OpenClaw is now running. You can access the web dashboard or interact through your connected messaging app.

Connecting to Telegram (Example)

  1. Open Telegram and search for @BotFather.
  2. Send /newbot and follow the prompts to create a bot. Copy the API token.
  3. In your OpenClaw config, add the Telegram integration:
    openclaw config set integrations.telegram.token "YOUR_BOT_TOKEN"
  4. Restart the gateway:
    openclaw gateway restart
  5. Send a message to your bot in Telegram — your AI agent will respond.

The same process works for WhatsApp, Slack, Discord, and other platforms. Check the OpenClaw documentation for platform-specific setup guides.

Connecting AI Model APIs

OpenClaw supports multiple AI providers. To switch or add a model:

# Use OpenAI
openclaw config set ai.provider openai
openclaw config set ai.openai.apiKey "sk-..."

# Use Anthropic (Claude)
openclaw config set ai.provider anthropic
openclaw config set ai.anthropic.apiKey "sk-ant-..."

# Use a local model via Ollama
openclaw config set ai.provider ollama
openclaw config set ai.ollama.model "llama3"

Some AI APIs have regional availability restrictions. If you experience connectivity issues with API endpoints, a proxy service like Just My Socks can help maintain a stable connection from any server location.

Security Best Practices

Running an AI agent with system access requires careful security hygiene:

Keeping OpenClaw Running 24/7

To ensure OpenClaw starts automatically after a server reboot, set it up as a systemd service:

# Create a service file
sudo tee /etc/systemd/system/openclaw.service <<EOF
[Unit]
Description=OpenClaw AI Agent
After=network.target

[Service]
Type=simple
User=openclaw
ExecStart=/usr/local/bin/openclaw gateway start
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

# Enable and start
sudo systemctl enable openclaw
sudo systemctl start openclaw

Getting Started

With a basic VPS and 30 minutes of setup, you get a private AI assistant that runs 24/7, connects to your favorite messaging apps, and handles real tasks autonomously. Here's a quick recommendation based on your needs:

Need a reliable proxy to connect your VPS to AI model APIs without interruption? Just My Socks provides stable, global proxy connections that pair well with any VPS setup.