Skip to content

Solutions · Bots

A VPS for a Telegram bot

A bot idles at under a hundred megabytes and spends its life waiting, so the machine is almost never the constraint — U1-1 at $7.90 a month runs one properly. What actually decides your bill is media, and whether you run your own Bot API server. Both are arithmetic, and both are below.

The decision under the decision

Webhook or long polling

This, not the plan, decides whether your bot needs a domain, a certificate and an open port.

Long polling

Your bot connects out to Telegram and waits for updates. No domain, no TLS certificate, no port open to the internet, works behind NAT. It is the fastest way to get something running and it is a perfectly good permanent answer for most bots.

Webhook

Telegram connects to you. Needs a public address, a valid certificate and an open port — all of which any plan here can do — and in exchange there is no polling loop and it scales better under real load. Move when load or latency says to, not before.

The arithmetic

How many bots a plan actually holds

Bots = (RAM − 300 MB operating system) ÷ what one bot holds. The two columns are a stateless command bot and one carrying an ORM, a scheduler and a cache.

Bot process capacity and monthly transfer allowance for each plan, with live prices
PlanRAMLight botsHeavy botsTransferPriceDeploy
U1-1One bot, any size of audience1 GB124Unmetered$7.90Deploy
C1-1-25One bot, metered but cheap1 GB1241 TB$9.90Deploy
GL2-4Several bots, or a bot with a database4 GB6325Unmetered$10.90Deploy
BD-8A self-hosted Bot API server8 GB1315232 TB$11.90Deploy

The number of users your bot has is not in this arithmetic, because it is not in the problem: Telegram hands your process updates one at a time rather than opening a connection per user. What changes the answer is state you hold yourself — a large cache, an in-process database, a model.

The number that decides the bill

Media, not memory

Average file size × messages a day × 30. Both directions count — a file received is traffic too.

Monthly transfer by message type at one hundred, five thousand and fifty thousand messages a day
What the bot moves100/day5,000/day50,000/day
Text onlyA command and a reply. Effectively free.< 1 GB< 1 GB3 GB
PhotosA compressed image, sent and received.< 1 GB44 GB439 GB
Voice notes and short videoThe usual load on a community bot.9 GB439 GB4.3 TB
Documents and long videoTelegram's own download ceiling for a plain bot.59 GB2.9 TB28.6 TB

The one thing that changes the machine

A bot on the public Bot API can download files up to 20 MB and upload up to 50 MB — Telegram's limits, not ours — and the files never touch your disk. Run your own Bot API server and the ceiling becomes 2 GB and every file lands on your server. That is the point where disk and transfer stop being incidental: BD-8 gives you 100 GB of NVMe and 32 TB for $11.90, which is the shape that suits. If you are not doing that, do not pay for it.

Honestly

What we would actually buy

We run a Telegram bot ourselves. This is the machine we would put it on.

For one bot

U1-1 · $7.90/mo

1 core, 1 GB, 15 GB NVMe, and no traffic meter — so a bot that unexpectedly starts moving media cannot produce a bill you did not expect. Put the bot under systemd with Restart=always, and the only remaining way for it to go down is your own code. If you outgrow it, moving a bot is copying a directory and a token.

Questions

What people ask before they buy one.

How much RAM does a Telegram bot need?
Far less than it is usually sold. A bot is a long-lived process that spends nearly all of its time waiting: a stateless command bot sits around 60 MB, and one carrying an ORM, a scheduler and a cache is nearer 150 MB. After the operating system takes its 300 MB or so, a 1 GB machine still has room for 4 heavy bots or 12 light ones. The number of USERS barely enters into it, because Telegram delivers updates one at a time to your process, not a connection per user. What does change the answer is state you hold in memory yourself — a large cache, an in-process database, a model.
Webhook or long polling?
Long polling to start, webhooks when it matters. With long polling your bot opens a connection out to Telegram and waits — it needs no domain, no certificate and no open port, which means it works behind NAT and is the fastest way to get something running. A webhook has Telegram connect to YOU, so it needs a public address, a valid TLS certificate and a port open to the internet, and in exchange it removes the polling loop entirely and scales better when the bot is genuinely busy. Both run fine on the smallest machine here. The honest reason to move is load or latency, not fashion.
What are the file size limits?
Telegram's own limits, not ours: a bot using the public Bot API can download files up to 20 MB and upload up to 50 MB. Running your own Bot API server lifts that to 2 GB and, more importantly, makes the files land on your server's disk rather than passing through Telegram's. That is the one change that genuinely alters what machine you need — suddenly disk and transfer matter, which is why the table above puts BD-8 against that row and not against the others.
Will I run out of bandwidth?
A text bot, never. A media bot, possibly, and it is worth thirty seconds of arithmetic: average file size × messages a day × 30. Fifty thousand voice notes a day at 3 MB is about 4.3 TB a month, which is past the allowance on most cheap plans and nowhere near the 32 TB on BD-8 — or the unmetered line, where the question does not arise. Both directions count: a file your bot receives and a file it sends are both traffic.
How do I keep the bot running after I close the terminal?
A systemd unit, not a screen session. Write a small service file with Restart=always, enable it, and the bot comes back after a crash and after a reboot without you being awake for it. This is the single most common reason a bot "goes down" on a VPS, and it is not a hosting problem — a process started by hand dies with the SSH session that started it. Docker with a restart policy does the same job if you would rather package it that way.
Can I run several bots on one server?
Yes, and most people should. Each is a separate process with its own systemd unit and its own token; they share the machine, the database if you want, and nothing else. The arithmetic in the table is exactly this question — a 4 GB machine holds 25 heavy bots before memory is the constraint. Keep them on separate ports and separate users if they are for different people.
Which region should the bot run in?
Anywhere your users can reach and your latency to Telegram is sane — the bot talks to Telegram's infrastructure, not directly to your users, so the usual "close to your audience" rule matters less here than for a website. If the bot also serves a web dashboard or an API to those same users, size the region for that instead. If you are unsure, deploy by the hour in two regions, measure, and destroy the one that loses: $0.0108 an hour makes that a cheap experiment.