OpenClaw Telegram Bot Setup
Setting up OpenClaw with Telegram involves BotFather, tokens, webhooks, TLS certificates, and pairing. Here's the complete manual guide - and the reason most people skip all of it and use PlugAndClaw instead.
Step 1: Create a Telegram Bot via BotFather
Every Telegram bot starts with BotFather - Telegram's official meta-bot for creating and managing bots. Open Telegram and search for @BotFather, then start a conversation.
Send the command `/newbot`. BotFather will ask for a name (this is the display name users see, like 'My AI Assistant') and a username (must end in 'bot', like 'myassistant_bot'). Usernames are globally unique across all of Telegram, so common names are taken.
Once created, BotFather gives you a bot token: a string that looks like `6123456789:AAH-abc123...`. This token is the credential OpenClaw uses to send and receive messages as your bot. Treat it like a password - anyone with this token can control your bot.
Copy the token. You'll need it in the OpenClaw configuration. Also note your bot's username - you'll need it to start the pairing process later.
Optional but recommended: use BotFather to set a profile photo for your bot (`/setuserpic`) and a description (`/setdescription`). These make your bot feel more personal and less like a generic setup.
Step 2: Configure OpenClaw with the Token
With your bot token, open the `openclaw.json` file in your OpenClaw installation directory. If this file doesn't exist yet, create it. The configuration structure for Telegram looks like this:
`{ "channels": { "telegram": { "token": "YOUR_BOT_TOKEN_HERE", "dmPolicy": "pairing", "streaming": true } } }`
The `token` field is your BotFather token. The `dmPolicy` controls who can message your bot - set this to `pairing` (recommended) so only paired users can interact with your assistant. Setting it to `open` means anyone who finds your bot can talk to it.
The `streaming` setting enables real-time response streaming - messages appear word by word rather than all at once. This makes conversations feel more natural but requires your server to maintain an open connection.
Save the file. OpenClaw will read this configuration on startup. Don't start the service yet - you still need to configure the webhook so Telegram knows where to send messages.
Step 3: Set Up HTTPS and Register the Webhook
Telegram webhooks require a valid HTTPS endpoint. Your server needs a domain name with a TLS certificate that Telegram can verify. Self-signed certificates won't work.
First, point a domain or subdomain to your server's IP address. If you're on a Hetzner VPS, the IP is in your Hetzner console. Add an A record in your DNS provider pointing `bot.yourdomain.com` to your server IP. DNS propagation takes 2-48 hours.
Next, install and configure Caddy as a reverse proxy. Caddy handles TLS certificate provisioning automatically via Let's Encrypt. A basic Caddyfile for this setup: `bot.yourdomain.com { reverse_proxy localhost:3000 }`. Start Caddy, and it requests a certificate for your domain automatically.
Once your HTTPS endpoint is working, register it as the webhook with Telegram. Make an HTTP GET request to: `https://api.telegram.org/bot<YOUR_TOKEN>/setWebhook?url=https://bot.yourdomain.com/webhook`
Telegram responds with `{"ok": true, "result": true}` on success. If you get an error, it's usually because your domain doesn't have a valid certificate yet or your firewall is blocking port 443. Check that `curl https://bot.yourdomain.com` works from an external machine before attempting webhook registration.
Step 4: Start OpenClaw and Complete Pairing
With the token configured and webhook registered, start the OpenClaw service. If you're running it manually: `cd /path/to/openclaw && npm start`. For systemd: `systemctl start openclaw`.
Check the logs for confirmation that Telegram connected successfully. You should see a line like 'Telegram webhook registered' or 'Listening for Telegram messages.' If you see authentication errors, double-check that the token in openclaw.json matches exactly what BotFather provided - even a single extra space will cause failures.
Now open Telegram and find your bot by its username. Send `/start`. If dmPolicy is set to `pairing`, your bot will respond with a pairing code or instructions to complete the pairing process. Follow those instructions to link your Telegram account to your OpenClaw instance as an authorized user.
Once paired, send a test message: 'Hello, are you there?' Your assistant should respond. If it doesn't respond within 30 seconds, check your server logs for errors - common issues at this stage are the webhook URL not being reachable from Telegram's servers, or the OpenClaw process having crashed silently.
Congratulations - if you've gotten this far, your OpenClaw Telegram bot is working. The full process typically takes 2-4 hours, and that's assuming nothing unexpected goes wrong.
Skip All of This with PlugAndClaw
The four steps above represent the minimum viable manual setup. In practice, first-time setup usually involves additional troubleshooting: firewall rules blocking Telegram's IP ranges, Let's Encrypt rate limits if you've tried multiple certificate requests, OpenClaw configuration syntax errors, or pairing flows that don't complete due to timing issues.
PlugAndClaw eliminates every one of these steps. When you sign up, our automated provisioner creates a dedicated Hetzner VPS for you, installs and configures OpenClaw, obtains TLS certificates, registers the Telegram webhook, and completes the pairing process - all in under 60 seconds.
You receive a single message in Telegram: 'Your assistant is ready.' From that moment, you have a fully configured, secure, 24/7 OpenClaw instance with your personal bot already paired to your account. No BotFather, no token management, no webhook registration, no firewall configuration, no certificate headaches.
The $39.50/month plan includes the server, the setup, the $20 AI credits, and the ongoing maintenance. If you've spent the last few hours working through the manual setup steps above, PlugAndClaw isn't just more convenient - it's also significantly faster to get to the part you actually care about: using your AI assistant.
All the configuration options described above (dmPolicy, streaming, webhook settings) are handled optimally by default. Advanced users who want to customize these settings can do so via SSH access to their dedicated server, which is included with every PlugAndClaw plan.
Frequently Asked Questions
Do I need a Telegram account to use OpenClaw?
Telegram is the primary interface for OpenClaw, so yes - you need a Telegram account. OpenClaw also supports other channels like Discord, but Telegram is the most common and best-supported option. Creating a Telegram account is free and takes about two minutes.
What is BotFather and why do I need it?
BotFather is Telegram's official bot for creating and managing other bots. When you set up OpenClaw manually, you use BotFather to create a new bot, which gives you a bot token (a long string like '123456:ABC-DEF...'). OpenClaw uses this token to connect to Telegram's API and receive your messages. Without the token, OpenClaw can't communicate with Telegram.
What is a webhook in OpenClaw's Telegram setup?
A webhook is how Telegram delivers messages to your OpenClaw server in real time. Instead of OpenClaw repeatedly asking Telegram 'any new messages?', Telegram pushes new messages directly to a URL you register. This requires your server to have a valid HTTPS domain. Setting this up manually involves configuring Caddy or nginx, getting a TLS certificate, and registering the webhook URL with Telegram's API.
How long does manual OpenClaw Telegram setup take?
Realistically, 2-4 hours for someone comfortable with Linux servers. Longer if you hit issues with TLS certificates, firewall rules, or the OpenClaw configuration format. Common sticking points include the webhook URL registration failing due to certificate issues, the pairing step not completing, and getting the dmPolicy setting correct in openclaw.json.
How does PlugAndClaw handle the Telegram setup?
PlugAndClaw automates the entire process. When you sign up, you're guided through a simple Telegram-based flow: start a conversation with our setup bot, enter your preferences, and your personal bot is created and configured in under 60 seconds. No BotFather interaction required, no webhook registration, no server configuration. You go from signup to chatting with your assistant in under 1 minute.
Your AI assistant. Live in under 1 minute.
⚡ Skip the Setup - Get Started Now$39.50/month - live in under 1 minute - 7-day money-back guarantee