Prerequisites
Three things need to be in place before you start. If any one of them is missing, the pairing step will silently fail.
Create a Telegram bot
Telegram bots are provisioned through @BotFather. Telegram's official bot management account. Open Telegram and start a chat with it.
/newbotBotFather will ask for two things: a display name (anything you like) and a username that ends in bot and is globally unique. Once confirmed, you'll receive a token:
123456789:AAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxConfigure the token
OpenClaw needs the token before the gateway starts. The exact method depends on your deployment: bare CLI, Docker Compose, or systemd. In all cases, the goal is the same: make the token available as an environment variable.
A · Environment variable (typical)
export TELEGRAM_BOT_TOKEN="123456789:AAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
openclaw gateway restartB · Docker Compose
Add the token to the environment block for your gateway service, then redeploy:
services:
gateway:
image: openclaw/gateway
environment:
- TELEGRAM_BOT_TOKEN=123456789:AAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxdocker compose up -d --force-recreateRestart & verify
After adding the token, restart the gateway so it picks up the new configuration. Then verify that the Telegram provider shows as healthy.
openclaw gateway restart
openclaw gateway statusThe status output should indicate the Telegram integration is enabled. If it shows as missing or errored, the token isn't being picked up. Double-check the variable name and restart again.
Pair your account
OpenClaw uses an approval step so random Telegram users can't connect to your assistant. You trigger a pairing request from Telegram, then approve it from the server.
5.1 · Trigger a pairing request
Open the bot you just created in Telegram and send any message. hi is enough. OpenClaw will respond with three pieces of information:
5.2 · Approve from the server
Back on the server, optionally list pending requests first, then approve by code:
# Optional: see all pending pairings
openclaw pairing pending
# Approve your pairing code
openclaw pairing approve telegram KZ2WLBGWaccess not configured again after approving, list pending requests and approve the new code.Confirm it works
Go back to Telegram and send another message to the bot. If the token and pairing are both correct, OpenClaw will relay your message to the assistant and stream the response back, directly in Telegram.
Troubleshooting
Three failure modes cover almost every case.
openclaw pairing pending
openclaw pairing approve telegram <NEW_CODE>openclaw gateway statusSecurity notes
A Telegram bot connected to your AI assistant has access to everything the assistant can do. A few practices worth keeping in mind.
You're connected
One bot, one token, one pairing approval. OpenClaw is now available in your Telegram, wherever you are, on any device, with no VPN or open port required.