Telegram bot hosting

How do I keep a Telegram bot online 24/7?

Run it where the process never sleeps and starts again on its own. On FadeHost a polling bot does that free: 256 MB of RAM, 3 GB of disk, no credit card and nothing to renew.

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 or upload your code, set the token, 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. There is nothing to renew. Only a free bot with no network traffic for 7 days is stopped, and Start brings it back. A paid bot is never stopped for being quiet, 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.

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, no renewal button to press and no question to answer every few days. Only a bot with no network traffic for 7 days is stopped, and you can start it again any time.

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.

Read on

Put your bot online now

One bot free, 24/7. No credit card, nothing to renew.

Host a bot, first one free

Free, no credit card

Host a bot, first one free