Telegram bots2 minutes to read

Where can I host a Telegram bot for free without buying a domain?

Run a Telegram polling bot on Bothosting’s free Spark plan, connect its BotFather token and check a private reply after your laptop is offline.

A free polling worker needs no public address

You can host a small Telegram bot on Bothosting’s free Spark plan using long polling. The worker asks Telegram for new messages over an outbound connection, so you do not need to buy a domain, open a port on your router or leave your laptop running. Spark includes one deployment, 256 MB of memory, 25% CPU and 512 MB of storage. Renew it manually every seven days.

A private command bot is a practical first project. The downloadable Node.js and Python examples each use their language’s standard library, so you can test the hosting and bot identity before adding a framework or a large dependency tree.

Get a reply from your own bot

  1. In Telegram, create a bot with BotFather and note its username. Save the issued token as TELEGRAM_BOT_TOKEN in the hosted deployment’s Variables.
  2. Choose a polling profile from Telegram bot hosting. Use MAIN_FILE=index.mjs for the Node.js example or MAIN_FILE=main.py for the Python example.
  3. Start the worker and open a private chat with the exact bot username you recorded. Send /start. The example replies “Your bot is running.”

What happens when you close the dashboard?

Closing the browser leaves the hosted worker running. Stop any local poller that uses the same token, close your laptop and send a new message from your phone. Run this test in a private conversation. The demonstration handler only matches the plain /start command there.

If you are moving an existing bot, check whether its old host registered a webhook. Telegram cannot deliver updates through polling while that registration is active. The webhook-to-polling guide explains how to keep pending messages during the move. Renew the hosting plan separately from any BotFather settings.