Build a fully functional Telegram bot with Webhook support using Java and Spring Boot β in just minutes. No complex setup, no boilerplate from scratch.
π Why Youβll Love This Template
If you're a:
- πΉ Java beginner exploring backend dev
 - πΉ Startup dev trying to ship an MVP quickly
 - πΉ Engineer needing a scalable foundation for bots
 
β¦this project helps you go from zero to bot in one evening.
π Who Is This Guide For?
- Beginner Java developers β who want to create a bot quickly without complex configuration.
 - Experienced programmers β who need a scalable bot that can integrate with enterprise systems.
 - Startup teams β when a fast MVP launch is critical.
 - Teachers and students - Spring Boot is a great fit for learning backend development.
 
π‘ Whatβs Included
β
 Spring Boot 3 + Java 21
β
 /start and /calc command handling
β
 Webhook endpoint via REST
β
 Clean architecture (Controller / Service / Client)
β
 Dockerfile + docker-compose.yml
β
 GitHub Actions CI
β
 Clear folder structure and YAML config  
π¬ Sample Commands
/start
/calc 2 * 3
/calc 12 / 4
π’ Quick Start in 2 Minutes
1. Clone the repository
git clone https://github.com/garaninsoft/telegram-bot-spring-boot-quickstart.git
cd telegram-bot-spring-boot-quickstart
2. Add your bot token
Open src/main/resources/application.yml and paste your Telegram Bot Token::
telegram:
  bot:
    token: your_token_here
3. Run the app via Docker π³ (recommended)
docker compose build
docker compose up
4. Set up Telegram Webhook
Use ngrok for local testing:
ngrok http 8080
Set the Webhook:
curl -X POST \
  https://api.telegram.org/bot<YOUR_BOT_TOKEN>/setWebhook \
  -d url=https://<your-ngrok-url>/webhook
β Done! Open Telegram, talk to your bot, and try /start.
π¦ Get the Code
π GitHub (Free)
π°Gumroad (Pro version with CI, Docker & frontend)
π§βπ» Support Option
Need help deploying to VPS, Railway, Render, or Fly.io?
Grab the Support pack to get:
- 1-on-1 help with setup
 - CI/CD pipeline setup via GitHub Actions
 - Docker mentoring
 - Telegram API questions answered
 
π Letβs Connect
Telegram: @garanin_soft
              


    
Top comments (0)