Telegram bots ยท 24/7

24/7 Telegram bot hosting, and what that actually takes

A polling bot asks Telegram for updates in a loop; a webhook bot waits to be called. Either way nothing happens while the process is stopped. 24/7 means a process that keeps running, starts again when it crashes, and comes back after the machine it runs on reboots.

Free plan
256 MB, the process never sleeps
Crashes
Started again, with the crash doctor
Deploys
Every push, rollback in one click
Paid
$2, $3 or $6 a month

What stops a bot, in practice

A laptop. It closes, it sleeps, it changes network. A bot running in a terminal stops with it, which is fine while you are writing the code and useless once people use it.

A machine at home. Power cuts, a router reboot, an operating system update at the wrong moment. It can be made to work with a process manager and some care, and it is your job forever.

A free web tier that spins a service down. Platforms built for web pages stop a service that has had no HTTP traffic for a few minutes. A page survives that, because the next visitor waits a moment. A bot does not. The usual workaround is to bolt a tiny web server onto the bot and have an uptime pinger hit it, which turns a bot into a web app to satisfy the platform and stops working the moment the pinger has an outage.

A bot here is not a web service and has no sleep timer on its process. There is nothing to ping.

The three ways that work

OptionWhat it costsWhat you do
An old PC or a Raspberry Pi at homeElectricity, and your own uptimeSet up auto-restart, keep it powered, survive power cuts
A VPS$4 to $6 a monthLinux administration, a process manager, updates, backups
Managed bot hostingFree, then $2 a monthConnect the repository, set the token, push to deploy

What always on means here

The bot runs in its own sandbox with hard memory and CPU limits. If it exits, it is started again and the crash doctor explains the reason in plain words instead of leaving you an exit code. If the node reboots for maintenance, the bot comes back with it. Every push to your branch redeploys, and the previous build is one click away if the new one is worse.

On the free plan the bot's process never sleeps; only a web address sleeps, and a polling bot has no address. A free bot is asked every few days whether it is still in use, with one click to confirm. A paid bot is never asked, picks its region, has no traffic limit and gets 1 GB of memory and a whole vCPU from $2 a month.

Polling or a webhook, when it has to be up

Polling has nothing to keep awake: the bot opens the connection to Telegram itself, so the free plan runs it as it is.

A webhook is Telegram calling your address over HTTPS on port 443, which means the address has to be awake when the update arrives. Every app can have one at https://name.fadehost.app with the certificate handled; keeping it awake is what the paid plans do from $2 a month.

Frequently asked questions

Does the free bot really stay online?

Yes. The process does not sleep and is started again if it exits. There are no coins to earn and no renewal button to press. The one thing asked of a free bot is a click every few days to confirm it is still in use, and opening or redeploying it in the panel counts.

Do updates get lost while the bot restarts?

Usually not. Telegram holds updates for a while and a polling bot collects them when it comes back, and a webhook that fails is retried. A short restart costs somebody a few seconds of waiting; a long outage is where things are actually missed.

What happens during maintenance?

Nodes are updated and the bots on them are restarted afterwards. A bot that was running comes back on its own.

How is this different from a VPS?

A VPS gives you a machine, and keeping the bot alive on it stays your job: the process manager, the updates, the restart after a crash. Here that is the platform's job, from $2 a month.

Can I be told when something goes wrong?

The bot's page shows its status and the crash doctor's explanation of the last failure, and the deploy history keeps the output of each start. An app with a web address can also have a health check path.

Related

24/7 Telegram bot hosting, and what that actually takes

Host a bot, first one free