What Python hosting means
Python hosting is a server plan that can keep a Python application process running all the time and pass web requests to it. That is the main difference from ordinary PHP hosting, where the web server runs a script for each request and nothing stays running in between. For a Django, Flask or FastAPI site, this usually means a VPS or an app platform, not a basic shared plan.
If you only run Python scripts on your own laptop, you do not need hosting at all. You need it when other people must reach your app through a domain name, at any hour, over HTTPS.
What a Python web app needs to run
Every production Python site is built from the same parts, whichever host you choose:
- A Python interpreter and a virtual environment. A virtual environment (
python3 -m venv venv) keeps your app's packages separate from the system's, so an OS update does not break your site. - An application server. The development servers that ship with Django and Flask are not for production. Their own documentation says so. In production the code runs inside a server such as Gunicorn or Uvicorn.
- A process manager. Something has to start the app when the machine boots and restart it if it crashes. On a Linux server that is normally systemd. On a platform or in containers, the platform does it.
- A reverse proxy. A web server such as Nginx sits in front, handles HTTPS, serves static files and buffers slow clients, then forwards the rest to the app server.
- A database and somewhere to keep secrets such as its password, outside your Git repository.
WSGI vs ASGI
These are the two standard interfaces between a Python web server and your code. Django's documentation sums it up: WSGI is the main Python standard but supports only synchronous code, and ASGI is the newer standard that is friendly to asynchronous code. ASGI also covers long-lived connections such as WebSockets, which WSGI's single request-and-response call cannot handle.
| WSGI | ASGI | |
|---|---|---|
| Style | Synchronous, one request and one response per call | Asynchronous, supports long-lived connections |
| Frameworks | Flask, Django | FastAPI, Django (it supports both) |
| Typical server | Gunicorn | Uvicorn, or Gunicorn managing Uvicorn workers |
| Choose it when | Classic page-and-form sites, admin panels, most APIs | WebSockets, streaming, many slow outbound calls |
Gunicorn uses a pre-fork model: one master process manages several worker processes that handle the requests. Its design notes suggest starting with (2 × CPU cores) + 1 workers and adjusting under load, and warn against running too many.
Python hosting options compared
| Option | How Python runs | Suits | Watch out for |
|---|---|---|---|
| Shared hosting with a Python app feature | The control panel starts your app through a built-in app server. In cPanel this is Application Manager, which uses Phusion Passenger, and only if the host has enabled it. | A small hobby app or a simple internal tool | Many shared plans do not offer it. No root, limited Python versions, tight memory, no background workers. |
| PaaS (app platform) | You push code. The platform builds it, runs it and restarts it. | Prototypes, and teams with no time for server work | Cost rises with every add-on. Regions may be outside India. Less control over the stack. |
| VPS | You install Python, Gunicorn or Uvicorn, Nginx and a database yourself, with full root access. | Most Django, Flask and FastAPI sites and APIs | You handle updates, the firewall and backups. |
| Dedicated or GPU server | The same as a VPS, on a whole physical machine | Heavy traffic, large databases, machine learning training and inference | Higher monthly cost. Worth it only when a VPS is clearly too small. |
Prices in India vary widely by provider and specification, and change often, so compare current price lists on the day you buy instead of trusting a figure in an article.
Why a VPS is the usual choice for Django, Flask and FastAPI
- Long-running processes are allowed. Gunicorn, Uvicorn, Celery workers and schedulers can all run as services.
- You pick the versions. Any Python release, any package with compiled extensions, any database.
- Everything can sit on one machine at first. App, database, cache and background worker on a single server is a perfectly good starting point.
- The cost is fixed. You pay for a size of server, not per request or per add-on.
- The skills carry over. Nginx, systemd and SSH work the same on every Linux host.
The price of that freedom is that you are the administrator. If you have never managed a server, budget a little time each month for updates and backups.
How much RAM does a Python app need?
There is no single figure, because Python apps vary more than PHP sites do. Size by workload:
- Count the workers. Each Gunicorn or Uvicorn worker is a separate process that loads its own copy of your app. Processes normally do not share memory, so four workers use roughly four times the memory of one.
- Add everything else on the box. The database, Redis, a Celery worker and the operating system all need their share.
- Data libraries change the picture. An app that imports pandas or loads a machine learning model holds that data in every worker. FastAPI's documentation gives the example of a 1 GB model: four workers need about 4 GB.
- Measure, then resize. Start small, watch
free -munder real traffic, and upgrade when free memory stays low.
Our guide on how much RAM a VPS needs has working figures for common stacks.
Choosing a region in India
The physical distance between your server and your visitors adds delay to every request. If most of your users are in India, on Jio, Airtel or a broadband line, a server in an Indian data centre answers sooner than one in Europe or the United States. It also keeps your data inside the country, which some clients ask for.
Within India, the two common choices are Mumbai and Delhi NCR. Mumbai is the usual default and suits users in the west and south. Delhi NCR suits a mostly northern audience. The difference between the two is small next to the difference between India and another continent, so do not agonise. You can measure from your own connection with our latency test. Bigdomainhost runs VPS servers in both cities, Mumbai (BOM-1) and Delhi NCR (DEL-1), at the same price in each region.
Deploying a Python app: the outline
On a fresh Ubuntu 24.04 VPS, a deployment follows these steps:
- Point your domain's A record at the server's IP address.
- Create a non-root user and log in with an SSH key.
- Install
python3-venv, Nginx and Git. Clone your repository and create a virtual environment. - Install your requirements plus Gunicorn. For FastAPI, add
uvicornand theuvicorn-workerpackage. - Put secrets in an environment file that only root can read.
- Write a systemd unit so the app starts at boot and restarts on failure.
- Add an Nginx server block that proxies to the app over a Unix socket or a
127.0.0.1port. - Open ports 80 and 443, then issue a free Let's Encrypt certificate with Certbot.
The commands look like this for a Django project:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt gunicorn
venv/bin/gunicorn --bind 127.0.0.1:8000 myproject.wsgi
That last line is only a test run. The full walkthrough, with the systemd units, the Nginx configuration and fixes for 502 errors, is in how to deploy a Flask, Django or FastAPI app on a VPS.
Databases, HTTPS, background jobs and cron
Databases
Django officially supports PostgreSQL, MariaDB, MySQL, Oracle and SQLite. SQLite is a single file and is fine for a small site with few writes. For anything busier, install PostgreSQL or MySQL on the same VPS, let it listen only on 127.0.0.1, and schedule a nightly dump that is copied off the server. A database with no backup stored elsewhere is one disk fault away from gone.
HTTPS
Terminate HTTPS at Nginx with a free Let's Encrypt certificate and let it renew automatically. Make sure Nginx passes the X-Forwarded-Proto header and that your framework is told to trust it, otherwise the app cannot tell that the visitor arrived over HTTPS.
Background jobs
Sending email, resizing images and calling slow APIs should not happen inside a web request. A task queue such as Celery moves that work to separate worker processes. It needs a message broker, typically Redis or RabbitMQ, and the worker runs as its own systemd service next to the web app.
Cron
For simple scheduled work, such as a nightly cleanup, cron is enough. Call the Python binary inside your virtual environment so the job sees the same packages as the site:
0 2 * * * cd /home/deploy/myapp && venv/bin/python manage.py clearsessions
Our cron jobs guide explains the schedule syntax.
Checklist before you go live
- Debug mode is off:
DEBUG = Falsein Django, no--reloadflag or debugger in Flask or FastAPI. - For Django,
python manage.py check --deployruns without warnings you have not read. - The app server listens on a socket or
127.0.0.1, never directly on a public port. - Secrets are in environment variables, not in the repository.
- The service restarts by itself: reboot the server once and confirm the site returns.
- Database backups run on a schedule and you have restored one as a test.
- HTTPS works and plain HTTP redirects to it.
Python hosting on Bigdomainhost
Bigdomainhost's shared cPanel plans are built for PHP sites and WordPress, so for a Python app the right product is a KVM VPS. It comes with full root access, NVMe storage and an Ubuntu 24.04 image, in Mumbai (BOM-1) or Delhi NCR (DEL-1). You add your SSH key when ordering, and an out-of-band console in the control panel gets you back in if a firewall change locks you out. Billing is in 30-day prepaid periods, and the current price is on the VPS page.
For machine learning workloads that need a graphics card, GPU servers are quoted per build. Questions before you order are welcome on WhatsApp at +91 75994 50220 at any time, by phone in IST business hours, or at support@bigdomainhost.com, in English or Hindi.
Sources (checked )
- Django documentation: How to deploy Django
- Flask documentation: Deploying to Production
- FastAPI: Deployments Concepts
- Gunicorn: Design
- Uvicorn: Deployment
- ASGI documentation: Introduction
How Bigdomainhost can help
For Django, Flask or FastAPI in production, a Bigdomainhost KVM VPS gives you everything this guide describes: full root access, an Ubuntu 24.04 image, NVMe storage and reserved RAM, in Mumbai (BOM-1) or Delhi NCR (DEL-1), close to your users in India.
- Usually ready in under 60 seconds: pick a region, add your SSH key and log in as root.
- 30-day periods prepaid from a rupee wallet, with no setup fee and the same price at renewal.
- An out-of-band console in the control panel if a firewall change locks you out.
- Snapshots before a risky change, so you can roll back.
- cPanel, Plesk or CyberPanel optional if you want a control panel.
- Phone support in IST hours and WhatsApp at any time, in Hindi or English.