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.
- Pre-Setup: What You Need
- Step 1: Create Your VPS
- Step 2: Install OpenClaw
- Step 3: Onboarding Wizard
- Step 4: Keep It Running (systemd)
- Step 5: Connect Telegram
- Step 6: Set Your First Prompt
- Step 7: First Conversation
- Step 8: Security Hardening
- Step 9: Tailscale Remote Access
- Step 10: First Automation
- Mac Mini vs VPS Comparison
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.
| Provider | Starting Price | Best For |
|---|---|---|
| Hetzner | ~$4.50/mo | Best value in Europe |
| DigitalOcean | ~$6/mo | Beginner-friendly docs |
| AWS Lightsail | ~$5/mo | If you already use AWS |
| Vultr | ~$6/mo | Worldwide locations |
| Hostinger | ~$4/mo | Budget-friendly |
2. Recommended Server Specs for OpenClaw
| Spec | Requirement |
|---|---|
| OS | Ubuntu 24.04 LTS |
| CPU | 2 vCPUs |
| RAM | 4GB minimum (2GB + swap works) |
| Storage | 40GB 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
- Go to hetzner.com/cloud and create an account
- Click "Add Server"
- Location: Choose the closest to you
- Image: Select Ubuntu 24.04
- Type: Choose CX22 (2 vCPU, 4GB RAM, ~$4.50/month)
- SSH Key: Set up below
- Click Create & Buy Now
Set Up SSH Key Authentication
Check if you already have a key:
ls ~/.ssh/id_ed25519.pubIf 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.pubFirst SSH Login to Your VPS
ssh root@YOUR_SERVER_IPType yes when asked about authenticity. Update the system:
apt update && apt upgrade -yCreate 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_keysTest in a new terminal: ssh agentuser@YOUR_SERVER_IP
Set Up the UFW Firewall
sudo ufw allow OpenSSH
sudo ufw enableAdd 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/fstabStep 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 | bashVerify:
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-daemonThe 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-gatewayIf 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-gatewayCritical 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 startStep 5: Connect Your Telegram Bot to OpenClaw
- Open Telegram, search for @BotFather
- Send
/newbot, enter your agent's name, choose a username ending inbot - 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 ABCD1234Step 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.mdStep 7: Your First Conversation with Your AI Agent
Message your bot on Telegram. Try these:
- "Hey! Who are you and what can you do?"
- "What files are in your workspace?"
- "Search the web for today's top news"
- "Create a file called test.txt with 'Hello World'"
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.jsonStep 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.xStep 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 telegramMac 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 difficulty | Medium (CLI) | Easy (has a screen) |
| Always on | Yes (99.9%) | Yes (if configured) |
| Data privacy | Provider's servers | Your hardware |
| macOS features | No | Yes (iMessage, etc) |
| Scaling | Upgrade in minutes | Buy new hardware |
What to Build Next with Your OpenClaw VPS
Your agent is alive. Here's where to go:
- Add more channels (WhatsApp, Discord, Slack)
- Install skills for new abilities
- Set up cron automations
- Refine SOUL.md as you learn what works
- Run
openclaw security audit --deepmonthly
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 →