Python hosting on your own VPS
Platform hosts for Python put your app to sleep, limit how long a job may run, or charge per request. A small VPS does none of that: your code runs as long as you want, on the Python version you choose, with any library from PyPI, including ones that need system packages. A natbox server costs from $1.00 a month, or nothing for your first month.
Try it free for a month · Order Nano
What people run
- Bots for Telegram and Discord, running day and night.
- Web APIs and apps with FastAPI, Flask or Django, on your own domain with HTTPS.
- Scheduled jobs: scrapers, reports, backups and price watchers on cron or systemd timers.
- Long-running workers that would hit the time limit on serverless platforms.
Which plan
| Plan | RAM | Good for | Price |
|---|---|---|---|
| Nano | 512 MB | A few bots or scripts, a small Flask or FastAPI app | $1.00 a month |
| Box | 1 GB | Django with PostgreSQL, several apps side by side | $1.25 a month |
| Box Plus | 2 GB | pandas and data work, many workers | $2.25 a month |
| Box CPU | 1 GB | CPU-heavy jobs that need a core of their own | $4.50 a month |
A typical Python process uses 30 to 150 MB. Every plan has hard RAM limits with no swap, so a process that grows past it is stopped instead of slowing the server down: check your app's memory with ps or htop on the free trial first.
How to set it up
- Pick Debian or Ubuntu. Both ship a current Python 3; for another version use
uvorpyenv. - Make a virtual environment per app:
python3 -m venv .venv, then install your requirements. - Run the app as a systemd service, so it starts at boot and restarts after a crash.
- For a web app, serve it with uvicorn or gunicorn behind Caddy or nginx, and link your domain in the client area's Domains tab.
Step by step: run a Python API, automatic HTTPS with Caddy, scheduled tasks, PostgreSQL on a small server.
Good to know
- There is no Docker: the server itself is a container. Python apps run fine without it, and use less memory that way.
- Outgoing mail ports 25, 465 and 587 are closed. Send email from Python through an email API over HTTPS (how).
- IPv4 is shared, so your app listens on one of your own ports, or on 80/443 through your domain. IPv6 is yours on every port.
Python hosting questions
Can I run Python scripts 24/7?
Yes. Run them as a systemd service and they keep going after you log out, start again after a reboot and restart if they crash.
Which Python versions can I use?
Any. The system Python comes with the distribution, and tools like uv or pyenv install any other version next to it.
Can I host a Django or FastAPI site?
Yes. Run it with gunicorn or uvicorn, put Caddy or nginx in front for HTTPS, and link your domain. Django with PostgreSQL is comfortable on Box.
Can I run Jupyter?
Yes, on your own port with a password or token. For a full editor in the browser, the code-server one-click app is easier.
Also see: Node.js hosting, self-hosting on a small VPS, cheap VPS plans.