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:
- Always online — Your AI agent keeps working when your laptop is closed or off. It can receive messages on Telegram at 3 AM and act on them.
- Access from anywhere — Send commands from your phone via WhatsApp or Telegram, no matter where you are.
- No resource drain — Your local machine stays fast. The VPS handles the AI workload.
- Stable network — VPS providers offer reliable, high-bandwidth connections that don't depend on your home internet.
What Can OpenClaw Do?
- Task automation — Schedule reminders, manage calendars, draft and send emails, organize files.
- Chat platform integration — Talk to your AI through WhatsApp, Telegram, Slack, Discord, or any of 15+ supported platforms.
- Web browsing — Fetch information, fill out forms, scrape data from websites.
- Shell commands — Execute scripts, manage server processes, automate DevOps tasks.
- Persistent memory — Unlike ChatGPT, OpenClaw remembers your previous conversations and preferences across sessions.
- 5,700+ community skills — Extend functionality through ClawHub, the community skill marketplace.
- Multi-model support — Works with Claude, GPT-4, DeepSeek, Gemini, or local models via Ollama.
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
- For API-only use: 1 vCPU, 1 GB RAM, 20 GB SSD
- For local models: 4 vCPU, 8 GB+ RAM, 80 GB+ SSD
- OS: Ubuntu 22.04 or 24.04 LTS recommended
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:
- Choosing an AI model provider (OpenAI, Anthropic, Google, or local Ollama)
- Entering your API key
- Connecting a messaging platform
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)
- Open Telegram and search for @BotFather.
- Send
/newbotand follow the prompts to create a bot. Copy the API token. - In your OpenClaw config, add the Telegram integration:
openclaw config set integrations.telegram.token "YOUR_BOT_TOKEN" - Restart the gateway:
openclaw gateway restart - 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:
- Keep OpenClaw updated — Early versions had a critical vulnerability (CVE-2026-25253, patched in v2026.1.29). Always run the latest version.
- Set a gateway auth token — Protect your dashboard:
openclaw config set gateway.auth.token "a-strong-random-token" - Review community skills before installing — Skills from ClawHub run code on your server. Only install well-reviewed skills from trusted authors.
- Use a firewall — Restrict inbound access to only the ports you need (SSH + gateway port).
- Run as a non-root user — Create a dedicated user for OpenClaw instead of running as root.
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:
- Budget pick: RackNerd — starting around $23/year, great for API-only setups.
- Balanced choice: BandwagonHost — reliable infrastructure from the team behind Just My Socks.
- For local models: Contabo — affordable high-RAM plans for running Ollama models on-device.
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.