What it costs
Hosting for an aiogram bot: how to run it and what it costs
In short
You can put an aiogram bot online with Netrun and no server: upload the folder with your code and requirements.txt, provide the BotFather token, and the platform installs the dependencies and starts the bot. The first 3 days are free; after that around-the-clock operation costs $1.49 a week or $4.99 a month. No VPS, no Docker, no autostart to configure.
aiogram is the most popular library for Telegram bots in Python, and almost every bot built with it follows the same path: first it lives in a terminal on a laptop, then the author closes the lid and the bot goes quiet. What usually follows is a hunt for a server, installing the right Python version, configuring systemd — and that is where the enthusiasm often runs out.
Yet an aiogram bot needs nothing special: it is an ordinary Python project with dependencies and a token. Here is how to put it online so it runs on its own, and what that costs.
Take the project as it is#
You need the bot file (usually bot.py or main.py) and a requirements.txt listing the libraries — aiogram at the very least. If there is no such file, generate one with pip freeze > requirements.txt inside the project folder. Pinning the aiogram version is worth it: the syntax changed noticeably between versions 2 and 3, and without a pin the build may install the wrong one.
Take the token out of the code#
The BotFather token should not sit as a string in your code: it would end up in the archive, in the repository and in its history. Read it from an environment variable instead — os.getenv("BOT_TOKEN"), for example. When you set the project up, Netrun asks for the value and injects it as a secret, so the token never lives in your files.
Upload the code#
Upload the folder as an archive or connect a GitHub repository — a private one works too. The platform sees requirements.txt, recognises a Python project, installs the dependencies and starts the bot. There is no Dockerfile to write and no Python version to pick by hand: it is detected from your code and your dependency file.
Leave long polling alone#
By default an aiogram bot fetches updates from Telegram itself (long polling), and that works unchanged on the platform — there is no need to rewrite the bot for webhooks. One rule matters: a single token can only have one running instance. Stop the bot on your own computer before publishing, otherwise Telegram hands updates to one copy and then the other, and the bot answers every other message.
Test the bot during the 3 free days#
On the free plan the bot runs for 3 days. Use that time to read the logs in your account: they show the dependencies installing, the bot starting and what it replies to commands. If something is off — a library missing from requirements.txt, say — you see the error as text instead of silence.
Turn on around-the-clock operation#
For the bot to answer permanently you need the Pro plan: $1.49 a week, $4.99 a month or $47.99 a year. The price covers the server, the build, restarts after a crash and logs. The bot's data — an SQLite database, for instance — lives in a persistent folder and survives code updates: publish a new version and your users and their settings are still there.
An aiogram bot is an ordinary Python project, and there is no reason to treat publishing it as something special. Upload the folder to Netrun, give it the token, and the bot starts replying without your computer.
Common questions
How much does hosting for an aiogram bot cost?
The first 3 days are free, which is enough to check everything. After that around-the-clock operation costs $1.49 a week, $4.99 a month or $47.99 a year. There is no separate charge for traffic, builds or logs.
Do I need to rewrite the bot for webhooks?
No. The long polling aiogram uses by default works as it is on the platform. Webhooks make sense when the bot is under heavy load or already has a web part, but for an ordinary bot you will not notice the difference.
Which aiogram version should I use, and how do I pin it?
The syntax differs a lot between aiogram 2 and aiogram 3, so pin the version explicitly in requirements.txt — aiogram==3.x, for example. Otherwise the build installs the latest release and code written for the older one fails on the first import.
Where should the bot keep its database?
Put the SQLite file in the project persistent folder — it is preserved between publications, so updating the code does not wipe your users. A database sitting next to the code is replaced by whatever was in the archive on the next publish.
What if the bot only answers every other message?
Most likely two running bots share the same token — a copy on your computer and a copy on the platform, for example. Telegram delivers updates to one receiver at a time, so replies alternate. Stop the extra instance.
What about python-telegram-bot or pyTelegramBotAPI?
Exactly the same. The platform recognises the project from requirements.txt rather than from a specific library, so bots on python-telegram-bot, pyTelegramBotAPI and any other library start the same way.
Can I host a Telegram bot?
Yes. Upload the bot code and provide the token from BotFather (Telegram itself gives it to you when you create the bot) — Netrun starts the bot, and no VPS or manual setup is needed. On the free plan the bot runs for 3 days so you can check everything; to keep it running around the clock, switch to the Pro plan.
Where do I set tokens and other secret values?
Every project has a Secrets tab where you set the values from your code — for example the token from BotFather. We store them encrypted: you can see the variable names, but the values are shown to no one, including you.
Is my data kept when I update the code?
Yes, as long as your data lives in persistent storage. For a regular project that is the /data folder: anything your app saves there stays in place when you update the code or restart, and you can browse and download the files on the "Data" tab. If you described the services yourself in docker-compose, persistent storage means the named volumes from your file, and such a project has no /data folder. Files written outside persistent storage are created from scratch on the next deploy. Your project link stays the same either way.
What happens to my bot after 3 days on the free plan?
The bot switches off, but your code, settings and secrets stay where they are — we delete nothing. A day before it switches off we send you a warning. Switch to the Pro plan, and the bot starts again from the same place and runs around the clock. A new bot uploaded after that is built too, but it will not start: free time is counted per account, not per project.