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
Long polling/startWhat 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 pollingA 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 domainSeparate 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 secretsDeploy 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 guidesConversation 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 botHow 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.
- Deploy Node.js polling bot on Spark
Node.js polling bot
Connects to Telegram from the worker. No public address needed.
- Deploy Python polling bot on Spark
Python polling bot
Run an aiogram, python-telegram-bot or other polling project.
- Deploy Node.js webhook bot on Spark
Node.js webhook bot
Receive Telegram updates at an HTTPS address.
- Deploy Python webhook bot on Spark
Python webhook bot
Receive Telegram updates in an HTTP app such as FastAPI.
Connect your bot to Telegram
Create the bot identity
Send
/newbotto BotFather, choose a username and save the issued token asTELEGRAM_BOT_TOKENin Variables. Keep the same identity when changing delivery mode.Load the entry file
Upload the Node.js example or the Python example. Set
MAIN_FILEtoindex.mjsfor Node.js ormain.pyfor Python. Each example supports both modes.Set the delivery address for webhooks
Polling can start immediately. For a webhook, append
/telegramto the HTTPS address in Settings, save it asTELEGRAM_WEBHOOK_URLand set a separateTELEGRAM_WEBHOOK_SECRET. The starter listens on0.0.0.0atSERVER_PORTand checks the secret header.Send a private message
Start the deployment and send
/startto the bot username. A reply from the example tests the whole path, including delivery from Telegram and the outgoing Bot API call.
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 pollingKeep 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.
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.
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.
| Plan | Memory | Storage | CPU | Deployments | File backup | History | Per year |
|---|---|---|---|---|---|---|---|
| Spark | 256 MB | 512 MB | 25% | 1 | Every hour | 24 hours | $0.00 |
| Relay | 1 GB | 5 GB | 50% | 2 | Every 15 minutes | 3 days | $22.50 |
| Circuit | 2 GB | 8 GB | 100% | 4 | Every 15 minutes | 7 days | $32.50 |
| Grid | 4 GB | 15 GB | 200% | 8 | Every 5 minutes | 14 days | $60.00 |
| Fleet | 8 GB | 25 GB | 250% | 12 | Every 1 minute | 30 days | $90.00 |
Spark1 deployment$0.00
- Memory
- 256 MB
- Storage
- 512 MB
- CPU
- 25%
- Deployments
- 1
- File backup
- Every hour
- History
- 24 hours
Relay2 deployments$22.50
- Memory
- 1 GB
- Storage
- 5 GB
- CPU
- 50%
- Deployments
- 2
- File backup
- Every 15 minutes
- History
- 3 days
Circuit4 deployments$32.50
- Memory
- 2 GB
- Storage
- 8 GB
- CPU
- 100%
- Deployments
- 4
- File backup
- Every 15 minutes
- History
- 7 days
Grid8 deployments$60.00
- Memory
- 4 GB
- Storage
- 15 GB
- CPU
- 200%
- Deployments
- 8
- File backup
- Every 5 minutes
- History
- 14 days
Fleet12 deployments$90.00
- Memory
- 8 GB
- Storage
- 25 GB
- CPU
- 250%
- Deployments
- 12
- File backup
- Every 1 minute
- History
- 30 days
Prices in USD before tax. A year costs the same as ten monthly payments.
Compare all plan featuresDo 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.