# Free hosting for a Python Telegram bot (aiogram)

https://netrun.io/en/blog/hosting-telegram-bota-na-python

_October 12, 2026 · 5 min read_

> You can host a Python Telegram bot for free on Netrun: upload the code with requirements.txt and enter the token from BotFather — the platform builds the environment and starts the bot, with no VPS, no card and no systemd. Around the clock and for free, a bot runs on the Pro plan, which Netrun gives for inviting friends: a week of Pro for every friend who pays for a plan, and a day of Pro for every friend who publishes a project. Without invitations the Free plan gives a bot 3 hours of running time — the clock only runs while the bot is running.

Your Python bot is ready: commands respond, aiogram is running, everything works on your computer. But the moment you close your laptop, the bot goes silent — because it lives locally on your machine. For it to answer around the clock, you need a computer that never shuts down, and usually that means renting a VPS, installing Python on the server, setting up autostart through systemd, and watching that the process does not crash.

For a bot on aiogram or pyTelegramBotAPI you can skip all of that. Let us walk through how to prepare your bot and run it on Netrun, where it will work without your computer and without any manual server setup.

## 1. Collect your dependencies in requirements.txt

Create a requirements.txt file in the root of your project and list the libraries in it — aiogram itself (or pyTelegramBotAPI) and everything your bot uses. You do not need to put the folder with installed libraries (venv) into the archive: the platform builds the environment from this list on its own.

## 2. Move the bot token out of your code

The token that BotFather gave you should not sit right in the code, and definitely should not end up in a public repository — otherwise someone could steal your bot. Read the token from an environment variable. When you set up the project, Netrun asks for this value and injects it as a secret outside your code.

## 3. Use long polling, not a webhook

For a simple bot the easiest approach is to stay in long polling mode — where the bot itself asks Telegram for new messages. That way you do not need to run a web server, configure a webhook, or open a port. aiogram and pyTelegramBotAPI work in this mode out of the box, and for hosting it is the most trouble-free option.

## 4. Check the start command

Make sure the bot starts with a single command — for example, python bot.py — and does not need any manual steps after it launches. If your entry point has a different name, the platform will offer to specify the start command during setup.

## 5. Upload the project to Netrun

Upload the code as a ZIP archive or import it from a GitHub repository — a private one works too. Netrun detects on its own that this is Python and recognizes the project as a bot. You do not need to pick a server, a Python version, or a way to start it manually.

## 6. Start and check the bot

Once the build finishes, the bot starts and begins answering in Telegram. Logs are visible in your dashboard in real time, so if the bot does not respond, the reason will be clear. To keep the bot running around the clock for free, invite friends: a day of Pro for every friend who publishes a project, a week of Pro for every friend who pays for a plan. Without invitations the Free plan gives a bot 3 hours of running time, then it stops while your code, settings and secrets stay in place.

A Python bot needs neither your always-on computer nor a rented VPS with systemd. Upload your code to [Netrun](https://netrun.io/), move the token into a secret — and the bot starts answering, for free. Around the clock and for free it runs on Pro, which Netrun gives for inviting friends; without invitations the Free plan gives a bot 3 hours of running time, and Pro can also be bought.

Related guides: [a Telegram bot without a VPS](https://netrun.io/blog/telegram-bot-bez-vps), [a bot running around the clock](https://netrun.io/blog/telegram-bot-kruglosutochno), [free bot hosting](https://netrun.io/blog/besplatnyy-hosting-telegram-bota).

## Common questions

### Where can I host a Python Telegram bot for free?

On Netrun: a Python bot can be launched for free, with no VPS and no card. Around the clock and for free it runs on the Pro plan, which Netrun gives for inviting friends: a week of Pro for every friend who pays for a plan, and a day of Pro for every friend who publishes a project. Without invitations the Free plan gives a bot 3 hours of running time, then it stops while your code, settings and secrets stay in place. Pro can also be bought with a one-off payment by Russian card, SBP or cryptocurrency.

### Does this work for aiogram and pyTelegramBotAPI?

Yes. Netrun detects that this is a Python project and starts the bot regardless of the library. The main things are to collect your dependencies in requirements.txt, move the token into an environment variable, and stay in long polling mode.

### Do I need a webhook and a web server?

No, for a simple bot long polling mode is enough — the bot fetches messages from Telegram itself. You do not need to run a web server, configure a webhook, or open a port.

### Will the bot keep working when my computer is off?

Yes. After you put it online the bot lives on Netrun servers, not on your computer, so it answers regardless of whether your laptop is on.

### Is it safe to store the bot token?

Yes, if you move the token into an environment variable and set it as a secret during setup. Then the token is not in your code or repository, and in the Netrun database it is stored encrypted.
