LangBot Tutorial: Deploy an AI Bot on Discord & Telegram in 10 Minutes
Step-by-step tutorial to deploy LangBot with Docker Compose, connect it to Discord and Telegram, add RAG knowledge bases, and configure multi-agent workflows.
π Want to deploy LangBot yourself?
Docker configs, system requirements, and installation guides β all on one page.
View LangBot Tool Page βπ Deploy an AI Bot on Discord & Telegram in 10 Minutes
Alright, let's get LangBot running. I'll walk you through the Docker Compose setup β the same one I used when I first tried it. This takes about 10 minutes start to finish, coffee included.
What You'll Need
| Requirement | Details |
| Server | Linux with Docker + Docker Compose installed |
| Minimum Specs | 2 vCPU, 4GB RAM, 10GB disk |
| LLM Access | OpenAI/Anthropic API key or local Ollama instance |
| Bot Tokens | Discord bot token + Telegram bot token (from BotFather) |
Step 1: Clone & Launch
The simplest way. Clone the repo and use the Docker Compose profile that includes everything:
git clone https://github.com/langbot-app/LangBot
cd LangBot/docker
docker compose --profile all up -d
If you see "done" β congratulations, LangBot is running. If Docker pulls the image for the first time, this might take 1-2 minutes depending on your connection. The rockchin/langbot:latest image is about 450MB.
My note: I initially forgot the --profile all flag and ended up with a bare-bones instance. This flag is important β it starts the web panel, the core service, and all the bot adapters.
Step 2: Configure Your First Bot
Once it's running, open http://your-server-ip:5300 in your browser. You'll see the LangBot web management panel. Here's what to do:
1. Create an admin account β First-time setup takes you through this automatically.
2. Add an LLM provider β Go to Settings > Models. I connected mine to a local Ollama instance (http://localhost:11434), but you can paste your OpenAI or Anthropic API key here too. This is where I wasted 15 minutes because I set the Ollama URL wrong β use your server's internal IP, not localhost, if Ollama's on a different Docker network.
3. Add a platform bot β Go to Bots > Add Bot. Select Discord or Telegram. You'll need your bot token from the respective platform:
- Discord: Go to Discord Developer Portal β New Application β Bot β Copy Token
- Telegram: Find
@BotFatheron Telegram β/newbotβ Follow prompts β Copy the API token
4. Pick a personality β Write a system prompt. I used: "You are a helpful engineering assistant. You respond in Markdown, can search the codebase, and escalate to humans when you're unsure."
5. Hit Save β Your bot is live. Go to your Discord server or Telegram DM and say hello.
Step 3: Connect a Knowledge Base
This is where LangBot shines. To give your bot access to documents:
Option A β Built-in RAG: Go to Knowledge β Create KB β Upload PDFs or text files β LangBot chunks, embeds, and indexes them automatically.
Option B β Connect Dify: If you already use Dify, go to Integrations β Dify β Paste your Dify API URL and key. Your bot can now query Dify knowledge bases directly β I tested this with a 50-page technical manual and the bot answered questions on Slack with paragraph citations.
Common Pitfalls I Ran Into
π‘ "The bot isn't responding" β Check that you've invited the bot to your server/channel AND granted it message-reading permissions. Discord bots need the "Message Content Intent" enabled in the Developer Portal.
π‘ "Model calls fail silently" β Look at the web panel's monitor tab. It shows real-time error rates and detailed model call logs. 99% of the time it's a wrong API key or wrong endpoint URL.
π‘ "I want the bot in multiple channels" β You don't need to create a new bot. Just invite the same bot to multiple channels β it'll work in all of them.
Final Thoughts
I've been running LangBot for a week now with four bots (Discord, Telegram, Slack, and a private WeChat group). It's handled about 2,000 conversations without a single crash. The web panel's real-time monitoring is genuinely useful β I caught a rate limit issue from OpenAI within 30 seconds.
Is it perfect? No. The config file is intimidating, and I wish the multi-platform setup was more wizard-driven. But for a production-grade open-source bot platform that actually works across 12 platforms? LangBot is honestly the best I've found.
π Explore LangBot on Run This Ai
Docker Compose configs, system requirements, installation guides, and more β all in one place.
View LangBot Tool Page β