How to Set Up OpenClaw on a VPS: The No-Nonsense Guide
Step-by-step tutorial for deploying OpenClaw on a VPS — from choosing a provider to connecting Telegram and hardening security. Under 30 minutes, no prior DevOps experience needed.
How to Set Up OpenClaw on a VPS: The No-Nonsense Guide
Most OpenClaw tutorials waste your first 10 minutes explaining what an AI agent is. You already know. You want your own agent running on a server, reachable from your phone, doing actual work. Let's get there.
This guide covers the full setup — from spinning up a VPS to chatting with your agent on Telegram. Total time: about 25 minutes if you type at a normal pace.
What You Need Before Starting
- A VPS with at least 2 vCPUs, 4GB RAM, and 40GB storage (Ubuntu 22.04 or newer)
- An API key from Anthropic, OpenAI, or Google — pick one
- A Telegram account (or WhatsApp, Discord, Slack — Telegram is fastest to configure)
- Basic comfort with a terminal. You don't need to be a sysadmin, but you should know what
sshmeans
Any VPS provider works. Hetzner, DigitalOcean, Linode, Vultr, Hostinger — they all run Ubuntu fine. The cheapest tier that meets the RAM requirement is enough for a single agent.
Step 1: SSH Into Your Server
Once your VPS is provisioned, grab the IP address from your provider's dashboard and connect:
ssh root@YOUR_SERVER_IP
First login on a fresh Ubuntu box? Update packages:
apt update && apt upgrade -y
Step 2: Install OpenClaw
One command. Seriously.
curl -fsSL https://openclaw.ai/install.sh | bash
The installer handles Node.js, dependencies, and the OpenClaw binary. It takes 2-3 minutes depending on your server's internet speed.
After installation, run the onboarding wizard:
openclaw onboard --install-daemon
The --install-daemon flag sets OpenClaw to start automatically on boot. Skip it if you prefer manual control, but for a VPS that should run 24/7, you want it.
The wizard walks you through:
- Choosing an AI provider (Anthropic, OpenAI, Google, or Ollama for local models)
- Entering your API key
- Setting a default model
- Configuring your first chat channel
Step 3: Connect Telegram
Open Telegram and search for @BotFather. Start a chat and send:
/newbot
BotFather asks for a display name and a username (must end in bot). Give it whatever you want — "MyAgentBot", "WorkBuddyBot", doesn't matter.
Copy the API token BotFather gives you. Back in your terminal:
openclaw channels add --channel telegram --token YOUR_BOT_TOKEN
Now open a chat with your new bot in Telegram and send /start. The bot responds with a pairing code. Copy that code, go back to your terminal, and approve it:
openclaw pair approve PAIRING_CODE
Send a test message to your bot. If it replies, you're connected.
Step 4: Choose Your Model
During onboarding you picked a default, but you can change it anytime:
openclaw models set anthropic/claude-sonnet-4-20250514
Or if you want something cheaper for casual use:
openclaw models set anthropic/claude-haiku-4-5-20251001
The model choice affects cost and quality. Sonnet is the sweet spot for most people — smart enough for real work, affordable enough to leave running. Opus is for complex reasoning tasks. Haiku is for high-volume, low-stakes interactions.
Check your configuration:
openclaw doctor
This shows gateway status, connected channels, AI model, and any warnings.
Step 5: Give Your Agent an Identity
OpenClaw uses a file called SOUL.md in your workspace to define your agent's personality and behavior. You can edit it directly:
nano ~/.openclaw/workspace/SOUL.md
Or just tell your agent through Telegram: "Update your SOUL.md — you're a senior developer who speaks concisely and uses code examples. Your name is Atlas."
The agent will update its own personality file. This shapes every response going forward.
Step 6: Install Skills
Skills extend what your agent can do. Browse what's available:
openclaw skill search web
Install a few essentials:
openclaw skill install web-search
openclaw skill install weather
For a list of community-built skills, check ClawHub — it's the skill marketplace where you can find everything from Gmail integration to security auditing tools.
Step 7: Lock Down Security
Your agent has shell access to your server. That's powerful but dangerous if misconfigured. Run the security audit:
openclaw security audit --deep
At minimum:
- Change SSH to key-based auth — disable password login
- Set up a firewall — only allow ports 22 (SSH) and 443 (if using dashboard)
- Review the agent's permissions — sandbox mode limits what commands it can run
- Don't give your agent root credentials to other services unless you trust the setup
The official security docs cover hardening in detail. Read them. A compromised AI agent with shell access is worse than a compromised server alone.
Step 8: Set Up Cron Jobs (Optional but Useful)
Want your agent to check your email every morning? Send you a weather report? Summarize overnight messages?
openclaw cron add --schedule "0 8 * * *" --message "Check my inbox and summarize anything important"
Cron jobs run in isolated sessions, so they don't pollute your main conversation history.
Verify Everything Works
Run through this checklist:
openclaw gateway status— should say "running"- Send a message to your bot on Telegram — should get a response
- Ask your agent to search the web — confirms skills are working
openclaw doctor— all checks should pass
If something's broken, openclaw doctor usually tells you what. The most common issues: wrong API key format, Telegram token not pasted correctly, or firewall blocking outbound connections.
Cost Expectations
The VPS itself: $5-15/month depending on provider and specs.
API costs depend entirely on usage. With Sonnet as your default model, casual use (20-30 messages/day) runs about $3-8/month. Heavy use with sub-agents and research tasks can hit $30-50/month. Monitor your spending through your API provider's dashboard.
What's Next
You've got a running agent. Now make it useful:
- Set up your AGENTS.md to define autonomous behavior
- Build a content pipeline for automated writing
- Explore multi-agent architectures for complex workflows
Need help with setup? MayaWorks offers setup-as-a-service — we configure everything and hand you a working agent.