A VPS on the smallest budget for bots and scripts: what matters for round-the-clock work
A bot, a small scraper, a sync script, a webhook handler: these are all background processes that must run around the clock and use almost no resources. For them a budget VPS is more convenient than a home computer or a free platform: the server has a permanent IP, it does not go to sleep and is not restarted on someone else's schedule. Within this price limit (roughly $2.5 a month) most plans offer one core and 1 GB of memory on KVM, and for background tasks that is usually more than enough.
How many resources a background task uses
- A Python bot (aiogram, python-telegram-bot) needs 50–120 MB per process, a Node.js bot 70–200 MB. Three to five bots with SQLite fit into 1 GB.
- Scripts run by cron or a systemd timer take memory only while they run, but they can hit the CPU limit if they process large files.
- A scraper with a headless browser is the exception: one Chromium instance takes 300–500 MB, so size such a task straight away by the requirements on the VPS for web scraping page.
- A database. PostgreSQL or MariaDB adds 150–300 MB. If SQLite is enough for the bot, a separate database server is not needed on this budget.
How to choose a plan within the range
Between the cheapest rows of the table and the top of the budget the difference is usually one thing: the lower part has more plans with 512 MB and container virtualization, while closer to the limit you find 1 GB on KVM. Any option will do for a single bot. If you have several bots, deploy them with Docker or plan to add a database, take 1 GB on KVM from the start: moving running bots is more trouble than the price difference. Tick KVM and the minimum memory in the filter, and the table will show only suitable plans.
And do not keep bot tokens and API keys in the code itself: move them to an environment file with 600 permissions or to the EnvironmentFile parameter of the systemd service. On a cheap server that nobody touches for months, a token leaked from a public repository is the last thing anyone notices.
Choosing a server for a specific bot, webhooks and location are covered in detail on the VPS for a Telegram bot page.
Keeping the bot from crashing at night
On a cheap server it is rarely the hardware that breaks, but the process itself: an exception in the code, a memory leak, a dropped connection to the API. So do not run it in screen or tmux, run it as a systemd service:
Restart=alwaysandRestartSec=5: the process comes back by itself after any crash and after a server reboot.MemoryMax=300M: if the bot starts leaking, systemd restarts only the bot instead of letting the OOM killer hit neighbouring services.- Write logs to journald and limit its size: on a 10–15 GB disk an overgrown journal is a common reason for the whole server suddenly stopping.
- Add an external heartbeat: every few minutes the bot pings a monitoring service, and if the signal stops you get a notification.
Plan limits people find out about too late
- Port 25 is closed. On inexpensive plans outgoing mail is often blocked. If a script sends emails directly, use an external SMTP service on port 587 or check the terms in advance.
- Traffic cap and port speed. Any cap is enough for a bot, but a script that downloads or serves files can use it up within a month.
- Container virtualization. On OpenVZ and LXC Docker does not always work and kernel parameters cannot be changed. If the bot is deployed with Docker Compose, choose KVM; container limits are described on the OpenVZ VPS page.
- Paying in advance. Some plans are listed with the price for paying 3–12 months ahead. For a bot that may turn out to be a two-week experiment, that means overpaying.
- First-month promotions. A low price may apply to the first payment only. Check the renewal price before moving anything permanent to the server.
Where to put the server
A bot does not need to be close to its users: 50–100 ms of latency to the messenger's servers does not affect the reply a person gets. Network stability and the node's uptime matter more. If bot downtime costs money, keep the configuration and data so that you can bring it up on another server in half an hour: an install script, a database backup, an environment file. On a cheap plan this costs less than paying for failover. Scripts that work with Russian websites, banks and accounting systems are better served by a server in Russia: latency is lower, and some of these services accept API requests only from Russian IP addresses. If your services are elsewhere, the same logic applies: put the server in the country whose APIs the script talks to.
If you get more bots or need a full database, the next step is the VPS under $6 selection with 2 GB plans. Prices and availability change, and the table above is updated every hour.