Running a C# Telegram Bot continuously on a free server

Hey everyone,

I’ve created a Telegram bot using C# in a Console Application. It works perfectly on my local machine, but I need it to run 24/7. Does anyone know if there’s a way to host a Console App on a free server that’ll keep it running all the time?

I’m looking for recommendations on platforms that offer this kind of service without any cost. I’m new to server hosting, so any advice would be really helpful!

Also, if there are better ways to set up a Telegram bot for continuous operation, I’m all ears. Thanks for any suggestions you can provide!

(English isn’t my first language, so please excuse any mistakes.)

hey there! i’ve been in ur shoes. have u considered using heroku? they got a free tier that might work for ur bot. just remember to set it up as a worker dyno, not a web dyno. that way it’ll keep running. good luck with ur project!

I’ve had success running Telegram bots on Azure Functions. They offer a generous free tier that’s perfect for small projects like this. The key is to set up your bot as a timer-triggered function that runs every few minutes. This approach keeps your bot active without the need for a constantly running console app. You’ll need to modify your code slightly to work with Azure Functions, but there are plenty of tutorials online to guide you through the process. Just be mindful of the monthly free quota to avoid unexpected charges.

I’ve been running my Telegram bot on Google Cloud Platform’s App Engine for a while now, and it’s been pretty solid. They offer a free tier that’s quite generous for small projects. The key is to set up your bot as a service that responds to HTTP requests, then use Cloud Scheduler to ping it every few minutes to keep it alive.

You’ll need to make some changes to your console app to make it work as a web service, but it’s not too complicated. There are plenty of tutorials out there to help you get started. Just be aware that you might need to learn a bit about cloud deployment and possibly some basic DevOps concepts.

One thing to keep in mind is that the free tier has some limitations on usage, so monitor your usage to avoid unexpected charges. But for a simple bot, you should be well within the free limits.