Articles

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

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.

Updated

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, checked on December 3, 2026, as were PythonAnywhere’s pricing, always-on tasks and allowlist, GitHub’s Actions limits and terms, and python-telegram-bot’s Application docs. The other hosts’ limits come from their own docs, as checked for our pages on free backend tiers (November 28), Render’s free tier (December 2), Cloudflare Workers and Vercel (December 3). Gregale’s come from its plans page.

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 has a complete FastAPI version that checks the secret header.

Free hosts for a Telegram bot

Free planWebhook botPolling bot, all monthThe catch
Gregale FreeYes: a parked bot restores in 50 to 83 msNo: 20 GB-RAM-hours run a 256 MB process for about 80 hours1 app with 256 MB, HTTP only, requests up to 30 seconds
Cloudflare Workers FreeYes: 100,000 requests a dayNo: a Worker runs only while it handles a request10 ms of CPU time per request; time spent waiting on Telegram doesn’t count
Vercel HobbyYes: a Python, Node.js or Go functionNo: a function ends at its maximum duration4 hours of Active CPU and 1 million invocations a month
Render FreeYes, but after 15 minutes idle the next update waits about a minuteOnly if an outside ping keeps it awake; one service fits 750 free hoursThe bot must also serve HTTP for the ping, and it loses local files at each spin-down
PythonAnywhere BeginnerYes, as a Flask or Django web app; api.telegram.org is on the free allowlistNo: always-on tasks are for paid accounts100 CPU-seconds a day, and outbound HTTP(S) only to allowlisted sites
Railway FreeYesOnly a very small one: Railway says $1 covers about 100 MB running all monthServices stop until the next billing cycle when the $1 runs out
Fly.io Free planYesYes: 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 FreeYesYes: a VM of your ownOracle 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 ActionsNoNo: a job stops after 6 hoursGitHub’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. Free is HTTP only, which is all a webhook needs. The FastAPI bot in our webhook bot guide 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 on GitHub.

A polling bot runs on Gregale as a worker: a service without ports: in a project 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, and the bot’s memory and reply time from our webhook bot guide, 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.