What if you could have your own AI assistant running 24/7 in the cloud, ready to answer you from Telegram at any time, and it only costs less than a Netflix subscription? That's exactly what we're building.

Follow the interactive guide: installopenclawnow.com

Make it easier: Open any LLM chat (Grok, Claude, Gemini, ChatGPT). Copy/paste this entire page and ask: "Help me install OpenClaw on a VPS based on this doc and official openclaw.ai documentation." If you're stuck, take a screenshot and ask your LLM to help you.

Pre-Setup: Everything You Need Before Installing OpenClaw on a VPS

Gather everything first. Think of this as your shopping list.

1. Choose a VPS Provider for Your AI Agent

A VPS (Virtual Private Server) is a computer in the cloud that you rent. Think of it like a tiny apartment for your AI agent.

ProviderStarting PriceBest For
Hetzner~$4.50/moBest value in Europe
DigitalOcean~$6/moBeginner-friendly docs
AWS Lightsail~$5/moIf you already use AWS
Vultr~$6/moWorldwide locations
Hostinger~$4/moBudget-friendly

2. Recommended Server Specs for OpenClaw

SpecRequirement
OSUbuntu 24.04 LTS
CPU2 vCPUs
RAM4GB minimum (2GB + swap works)
Storage40GB SSD
Cost$4-12/month

3. Get an Anthropic API Key

This is how your agent talks to Claude. Go to console.anthropic.com, create an account, navigate to API Keys, and create one. Typical cost: $20-50/month. You can set spending limits.

4. Create a Dedicated Gmail Account

Create a brand new Gmail for your agent. Keep your personal email separate.

5. Prepare Telegram

Download Telegram on your phone. We'll create the bot in Step 5.

6. Choose Your AI Model

Recommended: Claude Opus 4.6 (anthropic/claude-opus-4-6). Most capable model available. Alternatives: Claude Sonnet (faster/cheaper), Google Gemini (free tier), GPT-4.

Step 1: Create and Secure Your VPS for OpenClaw

Create Your Server on Hetzner

  1. Go to hetzner.com/cloud and create an account
  2. Click "Add Server"
  3. Location: Choose the closest to you
  4. Image: Select Ubuntu 24.04
  5. Type: Choose CX22 (2 vCPU, 4GB RAM, ~$4.50/month)
  6. SSH Key: Set up below
  7. Click Create & Buy Now

Set Up SSH Key Authentication

Check if you already have a key:

ls ~/.ssh/id_ed25519.pub

If not, create one:

ssh-keygen -t ed25519 -C "your-email@example.com"

Copy your public key and paste it into the provider's SSH Key section:

cat ~/.ssh/id_ed25519.pub

First SSH Login to Your VPS

ssh root@YOUR_SERVER_IP

Type yes when asked about authenticity. Update the system:

apt update && apt upgrade -y

Create a Non-Root User for OpenClaw

adduser agentuser
usermod -aG sudo agentuser
mkdir -p /home/agentuser/.ssh
cp ~/.ssh/authorized_keys /home/agentuser/.ssh/
chown -R agentuser:agentuser /home/agentuser/.ssh
chmod 700 /home/agentuser/.ssh
chmod 600 /home/agentuser/.ssh/authorized_keys

Test in a new terminal: ssh agentuser@YOUR_SERVER_IP

Set Up the UFW Firewall

sudo ufw allow OpenSSH
sudo ufw enable

Add Swap Space (If 2GB RAM)

sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Step 2: Install OpenClaw on Your Ubuntu VPS

Make sure you're logged in as agentuser.

# Install Node.js 22+
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs

# Install pnpm
sudo npm install -g pnpm

# Install OpenClaw
curl -fsSL https://openclaw.ai/install.sh | bash

Verify:

openclaw --help
openclaw doctor

"command not found"? Close SSH and reconnect: exit then ssh agentuser@YOUR_SERVER_IP

Step 3: Run the OpenClaw Onboarding Wizard

openclaw onboard --install-daemon

The wizard walks you through: QuickStart mode → Anthropic provider → API key → Claude Opus 4.6 → Telegram channel → Skills → Heartbeat.

Verify: openclaw health should show "Gateway: running".

Step 4: Keep OpenClaw Running with systemd (Linux Service Manager)

Check if the service is running:

systemctl --user status openclaw-gateway

If it doesn't exist, create it manually:

mkdir -p ~/.config/systemd/user

cat > ~/.config/systemd/user/openclaw-gateway.service << 'SVC'
[Unit]
Description=OpenClaw Gateway
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=%h/.openclaw/bin/openclaw gateway
Restart=on-failure
RestartSec=5
Environment=NODE_ENV=production

[Install]
WantedBy=default.target
SVC

systemctl --user daemon-reload
systemctl --user enable openclaw-gateway
systemctl --user start openclaw-gateway

Critical step: Enable lingering or Linux kills your agent when you log out:
sudo loginctl enable-linger $USER

OpenClaw VPS Management Commands

# Check status
systemctl --user status openclaw-gateway

# View live logs (Ctrl+C to stop)
journalctl --user -u openclaw-gateway -f

# Restart / Stop / Start
openclaw gateway restart
openclaw gateway stop
openclaw gateway start

Step 5: Connect Your Telegram Bot to OpenClaw

  1. Open Telegram, search for @BotFather
  2. Send /newbot, enter your agent's name, choose a username ending in bot
  3. Copy the bot token (keep it secret!)

Add to your config if the wizard didn't ask:

nano ~/.openclaw/openclaw.json
{
  "channels": {
    "telegram": {
      "enabled": true,
      "botToken": "YOUR_BOT_TOKEN_HERE",
      "dmPolicy": "pairing"
    }
  }
}

Restart and pair:

openclaw gateway restart
# Send any message to your bot on Telegram
openclaw pairing list telegram
openclaw pairing approve telegram ABCD1234

Step 6: Write Your AI Agent's First Prompt (SOUL.md)

cd ~/.openclaw/workspace
nano SOUL.md
# SOUL.md

You are [Agent Name], a personal AI assistant.

## Who You Are
- Helpful, proactive, and reliable
- Speak in a [casual/professional] tone

## Your Mission
[What should your agent do?]

## Rules
- Always ask before sending external messages
- Never share personal information
- Keep a daily log in memory/YYYY-MM-DD.md

Step 7: Your First Conversation with Your AI Agent

Message your bot on Telegram. Try these:

Step 8: VPS Security Hardening for Your AI Agent

# Run OpenClaw security audit
openclaw security audit --deep
openclaw security audit --fix

# Disable root login
sudo nano /etc/ssh/sshd_config
# Set: PermitRootLogin no
# Set: PasswordAuthentication no
sudo systemctl restart sshd

# Install fail2ban
sudo apt install -y fail2ban
sudo systemctl enable fail2ban
sudo systemctl start fail2ban

# Auto security updates
sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades

# Lock file permissions
chmod 700 ~/.openclaw
chmod 600 ~/.openclaw/openclaw.json

Step 9: Secure Remote Access with Tailscale (Mandatory)

# On your VPS
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up

# On your local computer: install from tailscale.com/download
# Then SSH via Tailscale IP
ssh agentuser@100.x.x.x

Step 10: Set Up Your First OpenClaw Cron Job Automation

Message your agent on Telegram:

"Set up a daily cron job at 8 AM that sends me a morning brief with today's weather, a motivational quote, and a summary of the top 3 tech news stories."

Or create one via terminal:

openclaw cron add --schedule "0 8 * * *" \
  --prompt "Send me a morning brief with weather and news" \
  --channel telegram

Mac Mini vs VPS: Which Should You Choose for OpenClaw?

VPS (Cloud)Mac Mini
Upfront cost$0$500-800+
Monthly cost$4-12/mo$5-10/mo (electricity)
Setup difficultyMedium (CLI)Easy (has a screen)
Always onYes (99.9%)Yes (if configured)
Data privacyProvider's serversYour hardware
macOS featuresNoYes (iMessage, etc)
ScalingUpgrade in minutesBuy new hardware

What to Build Next with Your OpenClaw VPS

Your agent is alive. Here's where to go:

Inside OpenClaw Lab, 250+ founders share their exact agent configurations, multi-agent setups, and automation playbooks. The fastest way to go from "it works" to "it runs my business."

I share the exact playbooks, skill files, and workflows behind this system inside OpenClaw Lab. Weekly lives and AMAs with experts.

Join OpenClaw Lab →