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.

💡
Who is this for?

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:

flowchart LR A[Create Server] --> B[SSH In] B --> C[Install Docker] C --> D[Get API Keys] D --> E[Configure] E --> F[Deploy] F --> G[Chat on Telegram] style A fill:#1e1b4b,stroke:#4338ca,color:#fff style G fill:#14532d,stroke:#22c55e,color:#fff

Prerequisites — what you'll need

Before we start, make sure you have these ready:

Total cost

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.

1
~2 minutes

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:

Click "Create & Buy Now". Your server will be ready in about 30 seconds. Copy the IP address — you'll need it next.

⚠️
Don't have an SSH key?

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.

2
~30 seconds

Step 2: Connect via SSH

Open your terminal and connect to your server:

bash
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.

3
~1 minute

Step 3: Install Docker

OpenClaw runs inside Docker containers, so we need to install Docker first. Run these commands one by one:

bash
# 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.

4
~3 minutes

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....

Save both keys somewhere safe.

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:

graph TD User[You on Telegram] -->|Message| TG[Telegram API] TG -->|Webhook| OC[OpenClaw Container] OC -->|API Call| AI[Anthropic Claude] AI -->|Response| OC OC -->|Reply| TG TG -->|Message| User OC -->|Read/Write| DB[(Local Storage)] style OC fill:#312e81,stroke:#a78bfa,color:#fff style AI fill:#1e1b4b,stroke:#3b82f6,color:#fff
5
~2 minutes

Step 5: Configure OpenClaw

Create the directory structure and config files:

bash
# 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):

json
{
  "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).

6
~1 minute

Step 6: Start the containers

Create the Docker Compose file:

bash
nano /opt/openclaw/docker-compose.yml

Paste:

yaml
services:
  openclaw:
    image: ghcr.io/openclaw/openclaw:latest
    container_name: openclaw
    restart: unless-stopped
    volumes:
      - ./data:/app/data
    ports:
      - "3000:3000"

Now start it:

bash
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).

7
You're done!

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.

That's it!

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:

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.