Bots
Free hosting for a Telegram bot
Free hosting for a bot is almost always a compromise, and it helps to know why. A website has idle time: while nobody opens it, it does nothing, so it can be put to sleep and woken again by the first request to its link. A bot has no idle time. It has no public link either: Telegram does not reach out to the bot, the bot keeps asking Telegram whether new messages have arrived. It is busy all the time, and there is nothing to wake it with — so nobody hosts a bot for free forever.
Platforms answer this differently. Heroku dropped its free plan long ago. Other overseas platforms still have one, but ask for a card from a foreign bank to sign up. That leaves a VPS: renting it, installing Python or Node.js, setting the process to start on its own, and a bill every month even for a single small bot.
With Netrun you can launch a bot and try it for free: no VPS, no card, no server setup. On the Free plan a bot runs for 24 hours and then shuts down, with a warning shortly before that happens. Your code, settings, and secrets stay where they are — nothing is deleted. To keep the bot running for good, you need the Pro plan, which has no time limit. What does live for free with no time limit on Netrun is websites: they fall asleep after fifteen minutes of inactivity and wake up on their own within a couple of seconds when someone opens them.
Get a token from BotFather#
Open @BotFather in Telegram, send the /newbot command, and follow the prompts. In reply you will get a token — a long string like 123456:ABC. It is the access key to your bot, issued by Telegram itself. You will need it during setup, so keep it handy and never show it to anyone.
Prepare the bot code#
A bot written in Python (the aiogram or python-telegram-bot libraries) or in Node.js (telegraf or grammY) will work. One important point: read the token not from a line in the code, but from an environment variable — a value that is set separately and does not live inside the files. In Python that is os.environ["BOT_TOKEN"], in Node.js it is process.env.BOT_TOKEN. That way the token does not leak along with the code.
Upload the project to Netrun#
Upload the code as a ZIP archive or import it from a GitHub repository — a private one works too. You do not need to include the dependencies folder (venv in Python or node_modules in Node.js); Netrun detects the language and builds the project on its own. There is no need to specify a port: a bot is not a website and does not listen for incoming requests.
Enter the token during setup#
Netrun asks which secrets the project needs. Add a variable with the same name you used in the code — for example, BOT_TOKEN — and paste the value of the token from BotFather. It is stored separately from the code, and the bot reads it at startup.
Launch and check#
Hit launch and watch the logs and build status right in your dashboard in real time. Once the project reaches a running state, message the bot in Telegram — it should reply. If the bot crashes later, Netrun restarts it automatically, so there is nothing for you to watch over.
When you have more bots#
The Free plan is one project — that is, one bot. If you want to keep a second bot or other projects, pay for room for one more: it adds a project on top of your plan. It does not change how a project runs: a second bot gets the same free 24 hours, and running without a time limit is what Pro is for. You pay for it up front for the whole term, and current prices are shown in your dashboard.
So you can take a bot from code to working in a few minutes, without touching a server and without paying for one up front. The free run is capped at 24 hours — a bot has no idle time, it is busy always, and nowhere is that free forever. From there the choice is simple: the Pro plan if you need the bot running for good, or a website — websites on the Free plan live as long as you like. Payment by a Russian card or SBP, support in Russian. Try Netrun.