# Where to host a Telegram bot: VPS, hosting and how to choose

What a bot needs to run, and how your own computer, a VPS, managed hosting and on-demand functions compare.

https://shiba-bank.com/en/guides/bot-hosting

Updated 2026-10-02 · 6 min read

A Telegram bot is an ordinary program, and it answers only while that program is running. Telegram does not host bots: its documentation says it offers neither hosting nor domain names. For a first bot your own computer is enough; for a bot that must always be online, most people rent a VPS (a virtual server) and keep the program running there around the clock. The choice depends on how your bot receives messages: through `getUpdates` or through a webhook.

## What a bot needs to run

A bot gets updates in one of two ways, described in detail in [getUpdates vs webhook](https://shiba-bank.com/en/guides/bot-api-updates).

- **getUpdates (long polling).** Your program calls `api.telegram.org` itself. You need no public address, no domain and no certificate, only outgoing internet access. That makes it the easy way to start and to debug a bot on your own computer. It needs a process that keeps running.
- **Webhook.** Telegram sends the updates to your address. According to Telegram's documentation you need a server with a domain name and one of the ports 443, 80, 88 or 8443. HTTPS is mandatory, TLS 1.2 or newer is supported, and the certificate's common name (CN) or SAN must match your domain. With a self-signed certificate you may use an IP address as the CN. Webhooks work over IPv4 only: IPv6 is not supported yet.

The webhook guide also has a word for anyone new to all this: if `getUpdates` already works for you, there is nothing wrong with it, so keep it.

## Where to run a bot: the options

| Option | Good for | Keep in mind |
| --- | --- | --- |
| Your own computer or laptop | First runs, debugging, a personal bot | The bot is silent when the computer is off or offline. No public address is needed, so `getUpdates` works. |
| A VPS (virtual server) | A bot that must always answer | You install the program and look after updates and security yourself. A webhook also needs a domain and a certificate. |
| Managed hosting (a platform that runs and restarts your code) | People who don't want to set up a server | Check that the platform keeps the process running and can provide an HTTPS certificate. Telegram advises looking for a host that handles SSL and lets you create or deploy certificates. |
| On-demand functions (serverless) | Webhook bots with light traffic | The code starts for each request, which is why it suits a webhook: every update arrives as an HTTPS request. Long polling needs a process that never stops, so these platforms usually don't fit it. |

No providers are named here on purpose: any one will do if it lets you run your program and, for a webhook, accept HTTPS requests.

## What to check when you choose

1. **Staying up.** The program should start when the server starts and restart after a crash. On a VPS people use a process manager such as systemd.
2. **One instance with getUpdates.** If two processes poll the same bot, Telegram answers with error 409 Conflict. Don't run the same bot on the server and on your own computer at once: see the [error guide](https://shiba-bank.com/en/guides/bot-api-errors).
3. **The bot's state.** If your bot remembers where a person is in a conversation, keep that in a file or a database, not only in the process's memory: a restart wipes the memory.
4. **Ports and protection.** For a webhook, open one of the four ports and make sure your program listens on it. To let only Telegram in, allow incoming traffic from the subnets `149.154.160.0/20` and `91.108.4.0/22`. To tell Telegram's requests from anyone else's, set `secret_token` in `setWebhook`.
5. **The token.** On the server keep the token in an environment variable or a file outside your repository, not in the code: [how to protect the token](https://shiba-bank.com/en/guides/bot-token).
6. **Checks.** After the start call `getMe` to check the token, and for a webhook call `getWebhookInfo`: it shows how many updates are waiting and the last delivery error.

> **Important:** Telegram keeps unconfirmed updates for no longer than 24 hours. If your bot stays offline for longer, some messages are lost.

## Your own Bot API server

For special cases Telegram has published the source code of the Bot API server: [telegram-bot-api](https://github.com/tdlib/telegram-bot-api). If you run it yourself, you can download files without a size limit, upload files up to 2000 MB, and use HTTP URLs, any local IP address and any port for webhooks. A beginner doesn't need it: an ordinary bot works well with the shared `api.telegram.org`.

## Load and limits

Hosting doesn't remove Telegram's limits. In one chat avoid sending more than one message a second, in a group no more than 20 messages a minute, and a mass broadcast is capped at about 30 messages a second. Beyond that you get error 429. What it means and how to retry is in the [Telegram Bot API errors guide](https://shiba-bank.com/en/guides/bot-api-errors).

## What next

If you haven't made the bot yet, start with [how to create a bot](https://shiba-bank.com/en/guides/create-telegram-bot). You can send the first message with [a curl request](https://shiba-bank.com/en/guides/bot-api-curl). If the bot will take payments, see [accepting Stars in your bot](https://shiba-bank.com/en/guides/stars-payments-in-bot).

## Frequently asked questions

### Where can I host a Telegram bot?
Your own computer is fine for testing; for round-the-clock work use a VPS or managed hosting. What matters is that the bot's program keeps running and can reach the internet.

### Do I need hosting for a Telegram bot?
A bot answers only while its program runs. If that is your computer, you need no hosting, but the bot goes quiet when you switch the computer off. For a bot that is always available, run the program on a server.

### Does Telegram provide hosting for bots?
No. The webhook guide says Telegram offers neither hosting nor domain name services and tells you to pick a provider yourself.

### Do I need a domain for a Telegram bot?
Not for `getUpdates`: no domain, no certificate, no open ports. A webhook needs a server with a domain name and HTTPS; with a self-signed certificate an IP address can stand in for the domain.

### Is a VPS good enough for a bot?
Yes, it is the most common choice. On a VPS the bot runs all the time, and you can set up either `getUpdates` or a webhook on it.

### Should I choose getUpdates or a webhook?
Without a domain and a certificate use `getUpdates`: it is simpler. A webhook fits when you have a server with HTTPS and want updates instantly, or when the bot runs on an on-demand functions platform.
