MyClaw handles all of this for you in 60 seconds. But if you're the kind of person who wants to understand how things work under the hood — or if you just want to self-host — this guide walks you through deploying OpenClaw manually on a remote VM, from zero to a working Telegram AI agent.
Absolute beginners who've never SSH'd into a server before. We'll explain every command. If you've deployed anything on a VPS before, you can probably skim through this in 5 minutes.
Here's the overall deployment flow:
Prerequisites — what you'll need
Before we start, make sure you have these ready:
- A Hetzner Cloud account — sign up at hetzner.com/cloud. You can use any cloud provider (DigitalOcean, Vultr, etc.), but we'll use Hetzner in this guide since that's what MyClaw uses.
- An Anthropic API key — get one at console.anthropic.com. This powers the AI brain of your agent.
- A Telegram Bot Token — we'll create this together in the guide using @BotFather.
- A terminal — Terminal on macOS, PowerShell on Windows, or any SSH client.
About $7-8/month for the server, plus whatever you spend on AI API calls (typically $5-20/month for personal use). Compare that to MyClaw's $49/mo managed plan, which includes all setup, security, monitoring, and updates.
Step 1: Create a cloud server
Log in to the Hetzner Cloud Console and create a new project (e.g., "My AI Agent"). Then click "Add Server" and configure:
- Location: Falkenstein or Helsinki (EU)
- Image: Ubuntu 22.04
- Type: CX22 (2 vCPUs, 4GB RAM) — this is plenty for a single agent
- SSH Key: Add your public key (or use a password, but SSH keys are more secure)
Click "Create & Buy Now". Your server will be ready in about 30 seconds. Copy the IP address — you'll need it next.
On macOS/Linux, run ssh-keygen -t ed25519 in your terminal, then paste the contents of ~/.ssh/id_ed25519.pub into Hetzner. On Windows, use ssh-keygen in PowerShell.
Step 2: Connect via SSH
Open your terminal and connect to your server:
ssh root@YOUR_SERVER_IP
Replace YOUR_SERVER_IP with the IP address from Hetzner. Type "yes" when it asks about the fingerprint. You're now inside your server.
Step 3: Install Docker
OpenClaw runs inside Docker containers, so we need to install Docker first. Run these commands one by one:
# Update the system
apt-get update && apt-get upgrade -y
# Install Docker
apt-get install -y docker.io docker-compose-v2
# Verify Docker is running
docker --version
You should see something like Docker version 24.x.x. Docker is ready.
Step 4: Get your API keys
Anthropic API key
Go to console.anthropic.com/settings/keys, click "Create Key", give it a name like "openclaw-agent", and copy the key. It starts with sk-ant-.
Telegram Bot Token
Open Telegram and search for @BotFather. Send /newbot, follow the prompts to name your bot, and copy the token it gives you. It looks like 7123456789:AAH....
You'll paste them into the config file in the next step. Never share these keys publicly — they give full access to your AI and Telegram bot.
Here's how the components connect:
Step 5: Configure OpenClaw
Create the directory structure and config files:
# Create the OpenClaw directories
mkdir -p /opt/openclaw/data/{workspace,credentials,agents/main/sessions,identity,canvas,cron}
# Create the config file
nano /opt/openclaw/data/openclaw.json
Paste this configuration (replace the placeholder values with your actual keys):
{
"models": {
"default": "anthropic:claude-sonnet-4-20250514",
"providers": {
"anthropic": {
"apiKey": "sk-ant-YOUR_KEY_HERE"
}
}
},
"channels": {
"telegram": {
"enabled": true,
"token": "YOUR_TELEGRAM_BOT_TOKEN"
}
}
}
Save the file (Ctrl+O, Enter, Ctrl+X in nano).
Step 6: Start the containers
Create the Docker Compose file:
nano /opt/openclaw/docker-compose.yml
Paste:
services:
openclaw:
image: ghcr.io/openclaw/openclaw:latest
container_name: openclaw
restart: unless-stopped
volumes:
- ./data:/app/data
ports:
- "3000:3000"
Now start it:
cd /opt/openclaw
docker compose up -d
# Check if it's running
docker compose logs -f
You should see logs showing OpenClaw starting up and connecting to Telegram. Press Ctrl+C to exit the logs (the container keeps running).
Step 7: Chat with your agent on Telegram
Open Telegram, find your bot by the name you gave it in BotFather, and send it a message. It should respond using Claude. Congratulations — you've deployed your own AI agent on a remote server.
Your agent is now running 24/7 on your own server. It will keep running even if you close your terminal. To stop it, SSH back in and run docker compose down.
What's next?
You now have a basic OpenClaw agent running. Here are some things you might want to do next:
- Add skills — OpenClaw supports installable skills like web scraping, email drafting, YouTube summaries, and more. Check the OpenClaw docs for the full list.
- Set up security — configure a firewall (
ufw), enable automatic security updates, and restrict Telegram access to your user ID only. - Enable HTTPS — if you want a web interface, set up Nginx with Let's Encrypt.
- Monitor uptime — use a free service like UptimeRobot to get alerts if your agent goes down.
- Back up your data — the
/opt/openclaw/datadirectory contains everything. Set up a cron job to back it up regularly.
Or, if all of this sounds like a lot of work — MyClaw does all of it for you. One click, 60 seconds, and your agent is live with security, monitoring, backups, and updates handled automatically.