Telegram bot hosting

Run a small polling bot on the Spark free plan, or receive updates at an HTTPS webhook. Both delivery modes have Node.js and Python starters you can test in a private chat.

Spark free plan · Renew every 7 days

Private chat example
Delivery modeLong polling
You send/start
Bot repliesYour bot is running.
Download the Node.js starter

What your Telegram bot can run

Polling without a domain

A reminder or support bot can collect updates over an outbound connection. Start the worker and close your laptop. The bot keeps the same username and users can keep their existing chat.

Set up long polling

A public HTTPS webhook

Receive Telegram updates on the deployment address shown in Settings. You can also verify a custom hostname and point Telegram at the same handler there.

Connect a webhook domain

Separate bot and webhook credentials

The BotFather token lets the process call the Bot API. A separate webhook secret lets the handler check incoming requests. Both belong in the deployment’s Variables and can change without rebuilding the project.

Set and rotate secrets

Deploy your Telegram framework

Use the polling profile for a bot built with aiogram, python-telegram-bot, grammY or Telegraf. Match the entry file and dependencies to your project.

Browse Telegram framework guides

Conversation state between messages

The starter keeps recent update IDs on disk. For a booking bot that remembers a customer’s choices over several messages, store your own conversation records by chat ID. A separate database can also serve a web dashboard.

Choose storage for a bot

How should updates arrive?

Choose polling for a standalone chat bot. Its worker opens an outbound connection and needs no public URL. Choose a webhook when your application already handles HTTP requests and can accept updates on a public HTTPS route.

Connect your bot to Telegram

  1. Create the bot identity

    Send /newbot to BotFather, choose a username and save the issued token as TELEGRAM_BOT_TOKEN in Variables. Keep the same identity when changing delivery mode.

  2. Load the entry file

    Upload the Node.js example or the Python example. Set MAIN_FILE to index.mjs for Node.js or main.py for Python. Each example supports both modes.

  3. Set the delivery address for webhooks

    Polling can start immediately. For a webhook, append /telegram to the HTTPS address in Settings, save it as TELEGRAM_WEBHOOK_URL and set a separate TELEGRAM_WEBHOOK_SECRET. The starter listens on 0.0.0.0 at SERVER_PORT and checks the secret header.

  4. Send a private message

    Start the deployment and send /start to the bot username. A reply from the example tests the whole path, including delivery from Telegram and the outgoing Bot API call.

Read the full deployment guide

Move a polling bot to an HTTPS webhook

Suppose your support bot already polls from a laptop. Move it with the same BotFather identity so subscribers can keep using the same chat.

Switch delivery back to polling
  1. Keep the last processed update

    Stop the poller before taking the final copy of its state. With either Bothosting starter, transfer the hidden .telegram-state directory with the code. If you use another framework, preserve the database or checkpoint your handlers already use.

  2. Register one receiving address

    Choose the matching Node.js or Python webhook profile. Set the full HTTPS URL ending in /telegram and a separate webhook secret. Start the bot and request /healthz on the same hostname to check that the listener is reachable.

  3. Test from the subscriber’s side

    Send a new /start in the existing private chat. Expect one reply from the same username. If the listener responds but the chat does not, inspect the registered URL and secret before making changes to DNS or replacing the bot token.

Telegram bot hosting plans

One account plan covers your deployments. Divide its memory, storage and CPU among the projects you run together.

PlanMemoryStorageCPUDeploymentsFile backupHistoryPer year
Spark256 MB512 MB25%1Every hour24 hours$0.00
Relay1 GB5 GB50%2Every 15 minutes3 days$22.50
Circuit2 GB8 GB100%4Every 15 minutes7 days$32.50
Grid4 GB15 GB200%8Every 5 minutes14 days$60.00
Fleet8 GB25 GB250%12Every 1 minute30 days$90.00
Spark1 deployment$0.00
Memory
256 MB
Storage
512 MB
CPU
25%
Deployments
1
File backup
Every hour
History
24 hours
Compare Spark
Relay2 deployments$22.50
Memory
1 GB
Storage
5 GB
CPU
50%
Deployments
2
File backup
Every 15 minutes
History
3 days
Compare Relay
Circuit4 deployments$32.50
Memory
2 GB
Storage
8 GB
CPU
100%
Deployments
4
File backup
Every 15 minutes
History
7 days
Compare Circuit
Grid8 deployments$60.00
Memory
4 GB
Storage
15 GB
CPU
200%
Deployments
8
File backup
Every 5 minutes
History
14 days
Compare Grid
Fleet12 deployments$90.00
Memory
8 GB
Storage
25 GB
CPU
250%
Deployments
12
File backup
Every 1 minute
History
30 days
Compare Fleet

Prices in USD before tax. A year costs the same as ten monthly payments.

Compare all plan features
Do I need to buy a domain for a Telegram bot?

No. Polling only needs an outbound connection. On a host with HTTP routing enabled, a webhook can use the HTTPS deployment address in Settings. A deployment can also use a hostname you control.

Can my Telegram and Discord bots share a plan?

Yes. Each bot gets a deployment with its own token, files and runtime. Reserve a slot for each and split the account’s memory, CPU and storage to cover their combined peak usage.

Can two workers poll the same bot?

Run one poller per token. A laptop copy and a hosted worker can compete for the same updates. Stop the other process, then send a new message in a private chat.

How do I switch from webhooks to polling?

Stop the webhook deployment and choose the matching polling runtime in Settings with files kept. The starter removes a webhook it registered itself. For a webhook registered elsewhere, remove it with the original app before starting the poller. Preserve .telegram-state so a redelivered update can be recognized.

Why does the health check work but my chat stays silent?

A response from /healthz proves the starter can serve HTTP. Check the registered HTTPS hostname, the /telegram path and the webhook secret, then test with a fresh /start message.