DETAILED GUIDE TO DEPLOY YOUR TELEGRAM BOT REPO ON KOYEB!! 🌐 ABSOLUTELY FREE! 🆓
(Method - Buildpack) 🌐
Deploying your Telegram bot shouldn't be complicated or expensive. This guide shows you how to deploy your private bot to Koyeb's free tier, keeping your code secure and accessible only to you.
📌
What You'll Need:• A Telegram Bot: Go to
@BotFather and create a bot.
• GitHub Account & New Repository: You'll need a GitHub account and a working repository that you want to create.
• Koyeb Account: Sign up for a free Koyeb account at
Koyeb🛡
Import & Set-up : Find a repository that you want to build. It shouldn't be old, newer repositories are more likely working. Copy the link of repo, you'll find an option for new repository at right sidebar of GitHub. Just go to it and import your repo. Paste the link and enter a name for your project. Start importing and wait until it's done.
✔️
Preparing Your Repository:Before deploying, you'll likely need to make some adjustments to your bot's code:
• Environment Variables: Read the README file in repo for instructions. You can insert your variables in .env file.
• Dependencies: Ensure you have a requirements.txt file listing all necessary Python packages (e.g., python-telegram-bot). Add gunicorn & flask if it's not already there.
• Koyeb-Specific Adjustments: If your repo doesn't contain a app.py file, then create it and insert the code inside it. I will provide the code.
CLICK HERE TO VIEW CODE⚙️
Koyeb Deployment Settings:1. Create a new Koyeb web application.
2. Connect your GitHub account to Koyeb. This allows Koyeb to access your private repository.
3. In your Koyeb service, import your private GitHub repository. Select "Buildpack" as method.
4. In your Koyeb service settings, you can add variables. (No need to do it if you already added variables inside the repo)
5. Set the run command as gunicorn app:app & [actual run command] click "Deploy." Koyeb will build and deploy your application.
Example - if the run command is python bot.py
Then the run command should be gunicorn app:app & python bot.py
6. After deployment, test your bot to verify functionality.
That's it! Your private Telegram bot is now deployed on Koyeb, all for free!
The guide contains only the Buildpack method, but Dockerfile is used for heavier projects. That would be a bit complicated but I can make that guide too if you all want.
If you have a doubt or facing issue,
Comment below or
TEXT ME ✉
AND DON'T FORGET TO JOIN OUR CHANNEL