# Free Telegram bot hosting 24/7: which free plans keep a bot online

Gregale · Updated 2026-12-03

A webhook bot runs free on many hosts because Telegram wakes it per message. A polling bot needs a process running all month: which free plans give you one.

**Yes, if the bot receives updates by webhook. Telegram then sends each
message to the bot’s HTTPS URL, so the bot only has to run while it answers,
and a free plan that sleeps or scales to zero still answers every message. A
bot that polls (`getUpdates`, or `run_polling()` in python-telegram-bot)
needs a process running all the time, and few free plans give you one:
Fly.io’s Free plan and Oracle Cloud’s Always Free VMs do, Railway Free does
for a very small bot, and GitHub Actions is not allowed for it.**

_Gregale publishes this page. Telegram’s rules come from its
[Bot API docs](https://core.telegram.org/bots/api), checked on December 3,
2026, as were PythonAnywhere’s [pricing](https://www.pythonanywhere.com/pricing/),
[always-on tasks](https://help.pythonanywhere.com/pages/AlwaysOnTasks/) and
[allowlist](https://www.pythonanywhere.com/whitelist/), GitHub’s
[Actions limits](https://docs.github.com/en/actions/reference/limits) and
[terms](https://docs.github.com/en/site-policy/github-terms/github-terms-for-additional-products-and-features),
and python-telegram-bot’s
[Application docs](https://docs.python-telegram-bot.org/en/stable/telegram.ext.application.html).
The other hosts’ limits come from their own docs, as checked for our pages on
[free backend tiers](https://gregale.dev/articles/free-backend-hosting-tiers-compared) (November
28), [Render’s free tier](https://gregale.dev/articles/does-render-free-tier-sleep) (December 2),
[Cloudflare Workers](https://gregale.dev/articles/cloudflare-workers-free-tier-limits) and
[Vercel](https://gregale.dev/articles/can-vercel-run-python-go-docker) (December 3). Gregale’s
come from its [plans page](https://gregale.dev/docs/plans.md)._

## Webhook or polling decides it

Telegram delivers updates in one of two ways, and a bot uses one or the
other:

- **Polling.** The bot calls `getUpdates` again and again. Something has to
  keep asking, so the process runs all the time. Most tutorials start here.
- **Webhook.** You call `setWebhook` with an HTTPS URL, on port 443, 80, 88
  or 8443, and Telegram sends each update there as a request. Nothing runs
  between updates.

Telegram keeps an update for up to 24 hours until the bot receives it, and it
repeats a webhook request that fails. So a webhook bot on a host that sleeps
answers late after a quiet spell instead of losing the message.

To switch a python-telegram-bot bot, replace `run_polling()` with
`run_webhook()`, install `python-telegram-bot[webhooks]`, and pass
`listen="0.0.0.0"`, the port your host gives you, a `url_path`, the public
`webhook_url` and a `secret_token`. Our
[webhook bot guide](https://gregale.dev/articles/telegram-bot-webhook-scale-to-zero) has a
complete FastAPI version that checks the secret header.

## Free hosts for a Telegram bot

| Free plan                | Webhook bot                                                                    | Polling bot, all month                                                       | The catch                                                                                                                    |
| ------------------------ | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **Gregale Free**         | Yes: a parked bot restores in 50 to 83 ms                                      | No: 20 GB-RAM-hours run a 256 MB process for about 80 hours                  | 1 app with 256 MB, HTTP only, requests up to 30 seconds                                                                      |
| Cloudflare Workers Free  | Yes: 100,000 requests a day                                                    | No: a Worker runs only while it handles a request                            | 10 ms of CPU time per request; time spent waiting on Telegram doesn’t count                                                  |
| Vercel Hobby             | Yes: a Python, Node.js or Go function                                          | No: a function ends at its maximum duration                                  | 4 hours of Active CPU and 1 million invocations a month                                                                      |
| Render Free              | Yes, but after 15 minutes idle the next update waits about a minute            | Only if an outside ping keeps it awake; one service fits 750 free hours      | The bot must also serve HTTP for the ping, and it loses local files at each spin-down                                        |
| PythonAnywhere Beginner  | Yes, as a Flask or Django web app; `api.telegram.org` is on the free allowlist | No: always-on tasks are for paid accounts                                    | 100 CPU-seconds a day, and outbound HTTP(S) only to allowlisted sites                                                        |
| Railway Free             | Yes                                                                            | Only a very small one: Railway says $1 covers about 100 MB running all month | Services stop until the next billing cycle when the $1 runs out                                                              |
| Fly.io Free plan         | Yes                                                                            | Yes: a 256 MB Machine running all month costs $2.19 of the $5                | $5 a month needs a card ($1 once, for 7 days, without one); past $5 the whole month is billed                                |
| Oracle Cloud Always Free | Yes                                                                            | Yes: a VM of your own                                                        | Oracle may reclaim an instance whose CPU and network use (and memory, on Arm) stay under 20% for 7 days, as a quiet bot’s do |
| GitHub Actions           | No                                                                             | No: a job stops after 6 hours                                                | GitHub’s terms rule out using hosted runners for anything unrelated to the repository’s software                             |

Three things the table doesn’t show:

- **Keep-alive pings use up an allowance.** A ping keeps one Render Free
  service awake, but every service you keep awake spends the workspace’s 750
  free instance hours.
- **PythonAnywhere’s free consoles are not a server.** A polling script in a
  console runs for a while, but PythonAnywhere restarts its servers from time
  to time, and only paid always-on tasks restart on their own.
- **An Always Free VM is a server to run.** You install, patch and restart
  the bot yourself, and if Oracle reclaims an idle instance, the bot stops.

## Where Gregale fits

A webhook bot fits the Free plan: 1 app with 256 MB and 20 GB-RAM-hours a
month, and requests can take up to 30 seconds. An app parks after 1 minute idle, holds
no memory while parked, and the next update restores it from a snapshot in
50 to 83 ms in [our measurements](https://gregale.dev/articles/cold-start-times-by-language).
Free is HTTP only, which is all a webhook needs. The FastAPI bot in our
[webhook bot guide](https://gregale.dev/articles/telegram-bot-webhook-scale-to-zero) used 75 MB
and sent the first byte of its reply 166 ms after an update reached it while
parked. The complete bot, with tests that send the requests Telegram would, is
[gregale-dev/telegram-bot-webhook](https://github.com/gregale-dev/telegram-bot-webhook)
on GitHub.

A polling bot runs on Gregale as a worker: a service without `ports:` in a
[project](https://gregale.dev/docs/multi-service.md) runs all the time and is billed for every hour.
A 256 MB worker running a 30-day month uses about 180 GB-RAM-hours, inside the
200 that Hobby includes for $10 a month. That leaves little for Hobby’s other
apps, so switching to a webhook is the cheaper fix.

## What to get right on any host

- **HTTPS on a supported port.** Telegram sends webhooks to 443, 80, 88 or 8443. A self-signed certificate works only if you upload it with
  `setWebhook`.
- **A secret token.** Set `secret_token` on the webhook and reject requests
  without the `X-Telegram-Bot-Api-Secret-Token` header, so a stranger who finds
  the URL can’t feed the bot fake updates.
- **Answer fast, and safely twice.** Telegram repeats an update that fails,
  so return 2xx quickly and use `update_id` to skip one you’ve handled.
- **One mode at a time.** While a webhook is set, `getUpdates` doesn’t work.
  Delete the webhook before going back to polling.

## What we verified

Telegram’s, PythonAnywhere’s, GitHub’s and python-telegram-bot’s docs on
December 3, 2026; the other hosts’ limits on the dates above. We didn’t
deploy a bot to the other hosts for this page. Gregale’s plans are from its
plans page on December 3, its restore times from
[cold start times by language](https://gregale.dev/articles/cold-start-times-by-language), and
the bot’s memory and reply time from our
[webhook bot guide](https://gregale.dev/articles/telegram-bot-webhook-scale-to-zero), measured
on November 27, 2026.

## Questions

### Can I host a Telegram bot for free 24/7?

Yes, if it receives updates by webhook: Telegram sends each message to the bot’s HTTPS URL, so the bot only runs while it answers, and free plans that sleep or scale to zero still answer every message. A polling bot needs a process running all the time, which Fly.io’s Free plan and Oracle Cloud’s Always Free VMs give you.

### Why does my Telegram bot stop working on a free host?

It probably polls with getUpdates or run_polling(). Polling needs a process that keeps asking Telegram for updates, and free plans that stop idle apps stop it too. Switch to a webhook, and Telegram’s request wakes the bot.

### Can I run a Telegram bot on GitHub Actions?

No. A job on a GitHub-hosted runner stops after 6 hours, and GitHub’s terms rule out using hosted runners for anything unrelated to the repository’s software.

### Does PythonAnywhere’s free plan run a Telegram bot?

A webhook bot, yes: run it as the free web app, and api.telegram.org is on the free allowlist. A polling bot, no: always-on tasks are for paid accounts, and consoles are restarted from time to time.

Canonical URL: https://gregale.dev/articles/free-telegram-bot-hosting-24-7

