← back to blog

Self-hosted bot or a hosted bot platform: what actually changes when you pick one

The question isn’t really “where do I host it”

Every Telegram bot is just a process that talks to the Bot API. Somewhere, something has to stay running, hold your bot token, and respond to updates. The decision people frame as “self-hosted vs hosted platform” is really a decision about who does the babysitting: you, or someone else. Both paths work. They just move the work to different places. Most of the pain people run into comes from not knowing where that work landed.

I run hosting and proxy infrastructure for a living. This isn’t theoretical for me. The same patterns show up everywhere - whether it’s a single bot for a community or a dozen bots doing different jobs across different accounts.

How a bot actually stays alive

A Telegram bot gets updates one of two ways: long polling or a webhook. Long polling means your process repeatedly asks the Bot API “anything new?” Telegram holds the connection open for a bit before responding. Webhooks flip that around. You give Telegram a public HTTPS URL, and Telegram pushes updates to you the moment they happen.

Long polling is simpler to start with. It doesn’t need a public IP, a domain, or a TLS certificate. You can run it from a laptop. But it means your process has to be running continuously. If it crashes at 3am, nothing answers until something restarts it.

Webhooks need a reachable HTTPS endpoint with a valid certificate (self-signed certs are allowed but add setup steps Telegram is picky about). They also need something in front of your process handling that traffic: nginx or Caddy as a reverse proxy is the common setup. In exchange, you don’t need a polling loop burning a connection. Telegram will retry delivery if your endpoint is briefly down.

This detail matters for the hosting decision because it decides what your server actually needs to be. Long polling can run on almost anything with outbound internet. Webhooks need a real server with a stable public IP and a domain pointed at it.

What self-hosting actually means day to day

Self-hosting a bot means you own the whole stack. A VPS or a box you control, a process manager keeping the bot alive (systemd, pm2, supervisor, whatever fits the language), and a restart policy for when it dies. It also means you’re the one who notices when it dies - unless you’ve wired up monitoring, which is its own small project.

For one or two bots doing lightweight work, this is genuinely not much overhead. A small VPS, a systemd unit with Restart=on-failure. You’re mostly done. The recurring cost is your own attention: dependency updates, the occasional library breaking change, watching disk space if you’re logging verbosely.

It gets heavier when you’re running several bots, especially if they’re doing anything beyond simple reply logic - calling external APIs, holding state in a database, running scheduled jobs. At that point you’re not hosting “a bot.” You’re running a small backend service. It needs the same operational care any backend does: backups, log rotation, alerting when something 500s.

One thing that surprises people coming from the Bot API into anything MTProto-based (client libraries that log in as a user account rather than a bot account) is that the rules change completely. That’s a different risk profile around account safety and outbound network behavior. It’s not what most people mean when they say “Telegram bot.” If your bot is a registered bot account talking to the Bot API, none of that applies to you.

What a hosted platform actually removes

A hosted bot platform (a PaaS aimed at bots, or a general-purpose PaaS you point your bot code at) removes the process-management layer. You push code. They keep it running, handle restarts, and often handle the TLS and webhook plumbing for you. What you’re paying for is not having to think about the server at all.

The tradeoff is control and, usually, cost per bot. You’re running inside someone else’s environment, on their schedule for maintenance, subject to their limits on memory, execution time, or outbound connections. For a bot that does something simple and well-defined, that tradeoff is usually a good one. For a bot with unusual requirements, like long-running background jobs or heavy state, you’ll spend time working around the platform’s assumptions instead of working around your own server’s assumptions. It’s still work. Just a different flavor of it.

It’s also worth being clear-eyed about what a hosted platform does not remove. You still need to understand webhook vs polling. You still need a bot token you keep secret. And you still need to handle Telegram’s rate limits in your own code (the Bot API returns 429s with a retry-after value, and your bot needs to respect that regardless of where it runs).

Where infrastructure choices actually bite

The place this decision quietly goes wrong is IP and network setup, not code.

If you’re self-hosting on a cheap VPS from a well-known datacenter range, that’s usually fine for a bot account talking to the Bot API. Bot traffic isn’t held to the same scrutiny as user account traffic. Where it matters more is if your bot makes lots of outbound calls to third-party APIs that do care about datacenter IPs - or if you’re running the bot alongside other infrastructure on the same box that does need a cleaner IP, like scraping or automation.

Webhook setup is the other spot people lose an afternoon. You need a domain, DNS pointed at your server, a certificate that’s actually valid for the domain (Let’s Encrypt handles this cheaply), and a reverse proxy terminating TLS and forwarding to your bot process on localhost. Get any one of those wrong and Telegram will just silently fail to deliver updates. There’s no obvious error on your end until you go check the webhook status via getWebhookInfo.

None of this is different between self-hosted and platform-hosted in principle. A platform usually does the domain and TLS part for you as part of the service. Self-hosting means it’s on your list.

A straightforward way to decide

If you’re technical enough to run a systemd service, and you want full control over logs, data, and how the bot behaves under load, self-hosting a VPS costs little and teaches you the whole stack. It’s the right call for one or two bots you plan to actively maintain.

If you’re running many bots, don’t want to think about servers, or want your time going into the bot’s logic rather than its uptime, a hosted platform is worth what you pay for it. Just budget for the platform’s limits, not just its price.

Either way, the mechanics don’t change. A bot token, an update delivery method, and something that keeps the process alive and answering. Everything else is just deciding who’s responsible for that last part.

If you want a hand thinking through hosting setup, webhook configuration, or how your bot’s network footprint looks from Telegram’s side, that’s the kind of thing we deal with daily. Come find us at telegramvault.org.

Get new guides and videos first — join the Telegram channel.

need infra for this today?