NetrunHome

How to run a VK bot without your own server

· 5 min read

A bot for a VK community is written fairly quickly: a library such as vkbottle or vk_api, a community token, a message handler. And then the familiar story begins — the bot only replies while your terminal is open. Close the laptop, let it sleep or lose the internet, and subscribers are writing into the void. The usual answer is to rent a server, install Python on it, set up autostart and make sure the process comes back after a reboot.

None of that is necessary. Netrun takes your code, detects the language, installs the dependencies, runs the bot on our servers and brings it back up if it crashes. Let us walk through it step by step — and be honest about where the free plan draws the line.

  1. Get a community token

    In your community settings, enable messages and bot capabilities, then create an access key with message permissions. That key is the token the bot uses to receive messages and reply on behalf of the community. Keep it to yourself: anyone holding it can post as your community.

  2. Move the token out of the code

    Read the token from an environment variable rather than from a string in the code. That way it ends up neither in the archive nor in the repository. During project setup Netrun asks for its value and passes it into the environment encrypted.

  3. Collect the dependencies

    Put a requirements.txt next to the code listing the libraries — vkbottle, vk_api or whatever you use. From it we know this is a Python project and install everything needed during the build. Do not include the virtual environment in the archive.

  4. Upload the code and start the bot

    Upload the folder as a ZIP archive or import a repository from GitHub, including a private one. Netrun builds the project and starts the bot, and the logs are visible in your dashboard in real time — they show right away whether the bot connected and whether it is crashing on an error. After that you can turn your computer off.

  5. Keep the free plan limit in mind

    A bot that waits for messages itself runs for three days on the free plan and then shuts down — a warning arrives a day in advance, and your code and token are kept. Three days is enough to check that everything builds and replies. Permanent operation needs the Pro plan. The reason is simple: a website can sleep when idle and wake up when the link is opened, while a bot is busy all the time and there is nothing to wake it with — that continuous work is what you pay for.

Keeping a community bot replying around the clock needs neither a laptop left on nor a rented server with autostart. Upload the code, provide the community token — and the bot stays online even when your computer is off. Try Netrun.

Common questions

What do I need besides the bot code?

Only a community token with message permissions and a requirements.txt listing the libraries. No server, no Python installation, no autostart configuration and no system maintenance.

Will the bot work when my computer is off?

Yes. The bot runs on our servers and does not depend on your computer. If it crashes, the platform restarts it, and the reason is visible in the logs in your dashboard.

Can I keep the bot on the free plan permanently?

No. A bot that waits for messages itself runs for three days on the free plan and then shuts down — the code and settings are kept. Round-the-clock operation needs the Pro plan. What lives on Netrun for free with no time limit is websites: they sleep when idle and wake up when the link is opened.

Does this work for a Callback API bot?

Yes. A Callback API bot is an ordinary web app that receives requests from VK, so it needs a public address with a secure connection. Netrun issues one right after publishing, and that is the address you enter in the community settings. The app must listen on the port from the environment variable rather than one hard-coded in the code.

Is it safe to keep the community token with you?

The token is stored encrypted and is not shown in plain text after saving. It should not be in the code archive or the repository — which is exactly why we ask you to enter it separately.

Can I run a Python project — Django, Flask or FastAPI?

Yes. Put your dependencies in requirements.txt — Netrun detects Python and builds the project for you. Django, Flask and FastAPI are supported; the app should listen on the port from the environment variable, and keys and database access are set as secrets rather than in the code.

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.

Where do I set tokens and other secret values?

In the project settings there is a section for values from your code — for example, the token from BotFather. We store them encrypted.