Rent a Linux VPS to run a Telegram bot around the clock. Consider 2 CPU cores and 4 GB RAM as a starting point for a small Python bot, then measure its process memory. Account separately for databases, media workers and browsers. Compare current MOTSELL plans and terms, or try the free polling example below with automatic startup via systemd.
If you run PostgreSQL or several workers, compare the 8 GB RAM configuration as well. Test CPU and memory needs with your own application.
Choose a VPS for your bot's workload
If your bot is already running, use its peak workload. Include the operating system, database, logs and temporary backup space. Enter the application's CPU requirement, not a utilization percentage.
The calculator does not send these values with your order.
Enter three positive numbers, with a whole number for vCPUs. If the bot is not running yet, start with the recommendations above.
The calculation does not compare processor speeds. Test your app and database under your workload. You will see the final total before paying.
Video: moving a bot from Railway to a VPS
Copying a SQLite database file can leave the latest requests behind. See how to avoid that during a Railway-to-VPS migration, verify startup and prepare a rollback.
Watch videoDownload the Linux example
The archive contains bot.py, a systemd unit, an environment template and setup instructions. There is no real token; an existing webhook is detected and left untouched.
Download Python bot and systemd (.zip)Example source and instructions on GitHub (MIT). A learning polling example, not a production payment application or high-availability design.

Key points
- Use Python 3.11+ with security updates or a version still security-maintained by your Linux distribution, and systemd. No pip packages are needed.
- Polling uses outbound HTTPS requests to Telegram.
- The token is configured separately; the process runs as an unprivileged dynamic user.
- Service restart and server reboot are separate checks.
Choose hosting for your Telegram bot
Measure the process under realistic load. Include peak memory for concurrent jobs, the operating system, and services such as PostgreSQL. Budget disk space for data, files, and logs. The example's 128 MB systemd limit is specific to the demo.
Long polling uses outbound HTTPS and needs no domain or inbound HTTP port. If your existing bot uses a webhook, prepare an HTTPS endpoint reachable by Telegram and a certificate before moving.
Choose the configuration and term in the MOTSELL catalog. After payment, select a location in Germany or Finland and a Linux image in the portal. If capacity is limited, your order may wait in a queue. Your rental term starts when the server is delivered. After delivery, install the bot and test Telegram API access from the VPS. You maintain the bot.
What the example does
The bot gets updates and echoes text in the same private chat. It ignores groups. An atomic offset file allows the next process to skip already acknowledged updates.
Use a separate test bot. The startup check refuses to remove an active webhook. Do not run a second polling process with the same token. A crash between reply delivery and offset persistence can duplicate a reply; this example is not a payment-processing or high-availability design.
Keep the token outside your code
Extract the archive and review bot.py and README.md. Run its guarded installation block as a whole: it stops if the target directory, unit, token file or a symbolic link already exists. Copying happens only after the checks. Install your distribution’s supported Python package if necessary.
Edit the token in the root-readable environment file. Avoid putting it into shell history, a public screenshot or a repository. systemd reads the file; DynamicUser runs the bot without root privileges.
python3 --version
systemd --versionStart the systemd service
After installing bot.py and configuring the environment file, copy and validate the unit. It enables startup with the system and restart after a failure. Invalid credentials or an active webhook stop the example as configuration errors.
The next offset is kept in /var/lib/motsell-bot-demo. The program does not log the token, message text or chat IDs. The 128 MB service cap bounds this demo; it is not a sizing promise for another application.
sudo systemd-analyze verify /etc/systemd/system/motsell-bot-demo.service
sudo systemctl daemon-reload
sudo systemctl enable --now motsell-bot-demo.service
sudo systemctl status motsell-bot-demo.serviceCheck recovery from the actual client
Send a private message to the test bot. Restart the service, then send another message and inspect its journal. Repeated HTTP failures need investigation of network access, credentials or a competing polling process.
A process restart does not prove startup after server reboot. Perform a controlled reboot only on your own test server where it will not interrupt other applications, then send another message.
sudo systemctl restart motsell-bot-demo.service
sudo journalctl -u motsell-bot-demo.service -n 30 --no-pagerSize the VPS from the workload
A text handler, database, media renderer and headless browser have very different needs. Measure process memory, peak jobs and concurrency before choosing a plan. Do not use this demo’s memory cap as a resource estimate for your application.
MOTSELL offers Linux VPS in Germany and Finland. Compare current CPU, RAM, disk and term in the catalog, then test the real route to Telegram after provisioning. The customer maintains the application, secrets, updates and backups unless separately agreed.
Verification scope
The repository checks use mocked Telegram responses: HTTPS requests, offset recovery after reloading state, group filtering, HTTP errors and token-safe error messages. They do not send real Telegram messages.
Your VPS route, real token and startup after reboot must be tested on your own installation. The offset file is not a backup of your business data.
FAQ
Does a Telegram bot need a domain?
This polling example does not. It makes outbound HTTPS requests to Telegram. A webhook-based application has different network requirements.
Why does the bot stop when I close SSH?
A process launched in a terminal can depend on the session. A systemd service separates process lifetime from SSH and provides startup and restart controls.
Can I use a token belonging to a working bot?
Use a separate test bot first. The example leaves active webhooks untouched and must not compete with another polling process.
Is 4 GB RAM enough for every bot?
No fixed amount fits every workload. Measure the runtime, database, concurrent work and peaks, then compare available plans.
Sources
Technical statements are checked against primary documentation.