How to Set Up Clawdbot on Telegram: Complete Guide
Telegram is probably the easiest platform to get Clawdbot running on. The bot API is well-documented, there's no approval process, and you can have your AI assistant up and chatting in under 30 minutes.
Here's exactly how to do it.
What you'll need
Before we start, make sure you have:
- A server (VPS or local machine) with at least 2GB RAM
- Docker installed on your server
- A Telegram account
- An AI API key (OpenAI, Anthropic, or similar)
Don't have a server yet? A managed Linux VPS is the easiest option โ no sysadmin skills required, and most providers have one-click Docker setups.
Step 1: Create your Telegram bot
This is the fun part. Open Telegram and search for @BotFather โ it's Telegram's official bot for creating bots (yes, a bot that makes bots).
Send /newbot and follow the prompts:
- Choose a display name for your bot (e.g., "My AI Assistant")
- Choose a username ending in
bot(e.g.,my_clawdbot) - BotFather will give you an API token โ save this, you'll need it
The token looks something like 7123456789:AAHfiqksKZ8WmR2zYnMOqP9jLpWGpXahBcs. Keep it secret.
Step 2: Install OpenClaw on your server
SSH into your server and run:
# Clone the repository
git clone https://github.com/openclaw/openclaw.git
cd openclaw
# Copy the example config
cp .env.example .envStep 3: Configure the environment
Edit the .env file with your details:
# Your Telegram bot token from BotFather
TELEGRAM_BOT_TOKEN=your_token_here
# Your AI API key
OPENAI_API_KEY=your_api_key_here
# Or if using Anthropic
ANTHROPIC_API_KEY=your_api_key_hereStep 4: Start the bot
docker compose up -dThat's it. Your bot is now running.
Step 5: Test it out
Go back to Telegram, find your bot by the username you chose, and send it a message. You should get a response within a few seconds.
Try something like:
- "What can you do?"
- "Remind me to call the dentist tomorrow at 3pm"
- "Search the web for the latest news about AI"
Keeping it running
The -d flag in the Docker command runs the bot in the background. It'll survive server reboots if you add a restart policy:
docker compose up -d --restart unless-stoppedTo check if it's running:
docker compose psTo see the logs:
docker compose logs -fCommon issues
Bot doesn't respond?
- Check your API token is correct in
.env - Make sure Docker is running:
docker ps - Check logs for errors:
docker compose logs
Slow responses?
- This is usually the AI API, not your server
- Try a faster model if available
- Check your server's internet connection
Bot responds but seems confused?
- Make sure you're using a supported AI model
- Check that your API key has sufficient credits
Tips for Telegram specifically
- Group chats: You can add your bot to group chats. It'll respond when mentioned by name or when you reply to its messages.
- Privacy mode: By default, bots in groups only see messages that mention them. This is usually what you want.
- Commands: You can set up custom commands through BotFather using
/setcommands. - Profile photo: Give your bot a profile picture through BotFather with
/setuserpicto make it feel more personal.
What's next?
Once your Telegram bot is running, you might want to:
- Connect additional platforms (WhatsApp, Discord)
- Customize the AI's personality and capabilities
- Set up automated tasks and reminders
- Explore the OpenClaw documentation for advanced features
The beauty of self-hosting is that you're in full control. Your conversations stay on your server, and you can tweak everything to your liking.
Need help with setup? Contact us โ we offer free installation assistance.