Bots
How to put a Telegram bot online without a VPS
In short
You can run a Telegram bot without a VPS: upload the bot code to a platform that builds and starts it for you, and add the BotFather token to secrets. On Netrun it is free: no server to rent, no card, no systemd and no Docker, and if the bot crashes it restarts automatically. Without invites a bot runs for 3 hours; around the clock it runs on the Pro plan, which you can get for free by inviting friends.
- A Telegram bot token comes from @BotFather in reply to the /newbot command.
- The bot token is read from an environment variable rather than kept in the code: on Netrun it goes into secrets and is stored encrypted.
- A polling bot needs no port and no public link: it asks Telegram for new messages itself.
- Netrun detects the bot language itself: requirements.txt means Python, package.json means Node.js.
- Bots on Netrun do not sleep: for free without invites a bot runs for 3 hours, and on the Pro plan it runs around the clock; Pro is given for inviting friends.
Normally, to keep a Telegram bot online you have to rent a VPS, set up Python or Node.js on it, write a systemd unit, keep an eye on the process so it does not crash, and pay for the server every month. For a first bot or a pet project, that is a lot of extra fuss.
Netrun takes the infrastructure off your plate: you upload your bot code and add the token — the server, startup, and restarts are on us. Here is how to do it in a few minutes.
Prepare your bot code#
Put your project in a single folder with a dependency file: requirements.txt for Python (for example, aiogram or python-telegram-bot) or package.json for Node.js (telegraf, grammY). Read the bot token from an environment variable instead of hardcoding it in the code.
Get a token from BotFather#
Open @BotFather in Telegram, send the /newbot command, and follow the prompts. You will get a token back — a long string like 123456:ABC. It is the access key to your bot, so keep it secret.
Upload the project to Netrun#
Pack your code into a ZIP archive or connect a GitHub repository, including a private one. Netrun detects the language and builds the project itself — no need to write a Dockerfile.
Add the token and launch#
When Netrun asks about secrets, paste the token from BotFather. Press launch — the project deploys to our servers, and your bot goes online.
Check that the bot replies#
Open the bot in Telegram and send /start. If it replies, everything works. Logs and status are visible in your dashboard, and if something fails, Netrun restarts the process automatically.
That is it: your bot lives on the internet without a server of your own. Publishing is free. Without invites the bot runs for 3 hours: the clock only ticks while it is running, and your code, settings, and token stay in place. To keep it online around the clock for free, invite friends: a day of Pro for every friend who publishes a project and a week of Pro for every friend who pays for a plan. Try Netrun.
Common questions
Why doesn't the bot reply after launch?
Check the logs in your dashboard: most often the token is missing or copied wrong, or a library from requirements.txt or package.json failed to install. If the logs show Conflict: terminated by other getUpdates request, a second copy of the same bot is running somewhere else — stop it.
Can I run the bot on a webhook instead of polling?
Yes. A webhook bot is essentially a web app: it has to listen on 0.0.0.0 and the port from the PORT variable, and the link Netrun gives you becomes the webhook address. Keep in mind that a web project sleeps on the Free plan, so a bot that must answer without delay is better off on the Pro plan.
What happens to the bot when the free time runs out?
The bot stops, with a warning shortly before. Your code, settings and token stay in place. Invite friends (a day of Pro for every friend who publishes a project, a week of Pro for every friend who pays) or pay for Pro, and the bot starts again and runs around the clock.
Can I publish a bot that an AI wrote?
Yes. Upload the code as is: Netrun detects the language and installs the dependencies. Just check that the token is read from an environment variable rather than written into the code.
How do I update the code of a running bot?
Upload the new version in your dashboard — as an archive, from GitHub or by publishing again from your AI editor. Netrun rebuilds and restarts the bot with the same secrets. There is no automatic publishing on git push.