
# Python VPS hosting for scripts, bots and data jobs

**Python VPS hosting gives your script or bot a server that stays on when your laptop doesn't: full root access, Python 3.12 on Ubuntu 24.04, and systemd restarting your process if it crashes.** On 0x.cloud, plans start at $4.49/mo (s1-1) or bill by the hour, and servers run in Warsaw.


[Create server: s1-2, $7.99/mo](https://0x.cloud/cabinet/create?plan=s1-2)



## What people run on a Python server

The most common workloads behind a search for a VPS for Python scripts:

- **Telegram and Discord bots** built with aiogram, python-telegram-bot or discord.py that must answer at 3 a.m.
- **Scrapers and data jobs** on a schedule with cron or systemd timers.
- **Monitoring and alert scripts** that watch prices, sites or queues.
- **AI bots** that call a model over an API while the server just holds the process and the data.

Shared hosting usually can't keep a long-running process alive, install system packages or pick your interpreter version. Free platform tiers cap runtime and outbound requests. A VPS removes those limits: outgoing connections to any API or site, and unmetered traffic at up to 1 Gbps.

## Pick a plan for your Python workload

| Workload | Plan | Specs | Monthly |
|---|---|---|---|
| Monitoring script, simple bot | s1-1 | 1 vCPU, 1 GB RAM, 15 GB NVMe | $4.49 |
| AI bot on an API model | **s1-2** | 1 vCPU, 2 GB RAM, 30 GB NVMe | $7.99 |
| PostgreSQL, several bots, browser scraper | s2-4 | 2 vCPU, 4 GB RAM, 60 GB NVMe | $15.99 |
| Heavy scraping, Celery workers, pandas on big datasets | s4-8 | 4 vCPU, 8 GB RAM, 120 GB NVMe | $31.99 |

Not sure how much memory your code needs? Bill hourly (s1-2 runs about $0.054725 per hour), watch `free -h` under real load, then create your production server on a monthly or yearly term (12% off for a year). Whatever is left from the test returns to your balance. Hourly billing never costs more than the monthly price over a month, and the price is locked for the whole paid term.

## Ready-made environment: the Bots image

When you create a server, pick plain Ubuntu 24.04, Debian 12 or AlmaLinux 9, or the Bots image. It comes with Python and libraries for Telegram and Discord plus a service that keeps your bot running, so you only upload code and a token. Prefer containers? Docker installs with one command from the official script.

## Python VPS setup: run a script 24/7 in 4 steps

Commands for Ubuntu 24.04. The longer walkthrough with logs and timers is in [run a Python script 24/7](https://0x.cloud/deploy/python-script-24-7).

1. **Install venv and pip.** Ubuntu 24.04 already ships [Python 3.12](https://packages.ubuntu.com/noble/python3); you only need the environment tools:

```bash
sudo apt update
sudo apt install -y python3-venv python3-pip git
```

2. **Create a dedicated user and a virtual environment.** Don't run the bot as root, and don't install into the system Python: that fails with `externally-managed-environment`, by design:

```bash
sudo adduser --disabled-password --gecos "" bot   # passwordless user for the service
sudo -iu bot                                       # continue as that user
git clone https://github.com/you/mybot.git ~/mybot && cd ~/mybot
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
```

3. **Write a systemd unit** so the script survives logouts and reboots. Type `exit` to get back to your admin user, then create the unit file:

```ini
# /etc/systemd/system/mybot.service
[Unit]
Description=My Python bot
After=network-online.target
Wants=network-online.target

[Service]
User=bot
WorkingDirectory=/home/bot/mybot
ExecStart=/home/bot/mybot/.venv/bin/python main.py
Restart=always
EnvironmentFile=/home/bot/mybot/.env

[Install]
WantedBy=multi-user.target
```

4. **Start it and follow the logs:**

```bash
sudo systemctl daemon-reload
sudo systemctl enable --now mybot
journalctl -u mybot -f
```

A full bot example lives in [deploy a Telegram bot in Python](https://0x.cloud/deploy/telegram-bot-python).

## Let your AI agent create the server

On 0x.cloud, an AI agent such as Claude Code, Codex or Cursor can create the server for you through MCP or the API. The agent's key has its own permissions and monthly spend cap, and `dry_run` returns the exact price before anything is created.


```text
Create an s1-2 server with Ubuntu 24.04 on 0x.cloud. Clone my repo, create a virtual environment, install requirements.txt, and run main.py as a systemd service with Restart=always. Show me the dry_run price first.
```


## Python hosting options compared

| Option | 24/7 background processes | System packages | Billing |
|---|---|---|---|
| Shared hosting | usually not | no | flat |
| PaaS free tier | within platform limits | partly | usage-based |
| 0x.cloud VPS | yes, via systemd | yes, root access | from $4.49/mo or hourly |

Scraping with proxies and a headless browser? See [VPS for web scraping](https://0x.cloud/vps-for-web-scraping). Every plan and term discount is on the [pricing page](https://0x.cloud/pricing).

## Python VPS hosting FAQ

**How much RAM does a Python VPS need?**
A small script or bot without a database runs fine on 1 GB (s1-1, $4.49/mo). An AI bot calling a model API is more comfortable on 2 GB (s1-2, $7.99/mo). Several bots with PostgreSQL or a scraper driving a headless browser want 4 GB (s2-4).

**Which Python version comes with Ubuntu 24.04?**
Ubuntu 24.04 LTS ships Python 3.12. Create a virtual environment per project with `python3 -m venv .venv` and install your dependencies inside it.

**Why does pip install fail with externally-managed-environment?**
Ubuntu 24.04 and Debian 12 protect the system Python from pip installs that bypass apt. Create a virtual environment, activate it, and install packages there instead of using `--break-system-packages`.

**How do I keep a Python script running after I close the console?**
Run it as a systemd service with `Restart=always` and enable it with `systemctl enable --now`. It survives closing the console, logouts and reboots and restarts itself after a crash.

**Is a VPS better than shared hosting for Python?**
For anything long-running, yes. Shared hosting usually blocks background processes, system packages and custom Python versions. A VPS gives you root, cron and any library you need.
