• FastAPI
  • Uvicorn
  • NGINX
  • systemd

FastAPI VPS HostingA production API server, not a dev server

FastAPI's own docs say to serve production with fastapi run or Uvicorn, not the reload server. We set up Python, a systemd service for Uvicorn, NGINX with free SSL and a database on a hardened KVM VPS. You deploy your app and go live.

  • KVM virtualisation
  • NVMe storage
  • Root SSH access
  • Free one-time setup
  • 99.9% uptime SLA

systemctl list-units --type=service --state=active

  • nginxHTTPS reverse proxy
  • myapiUvicorn running your FastAPI app
  • postgresqldatabase server
  • ufwfirewall: 22, 80, 443
  • fail2banSSH brute-force guard
  • unattended-upgradessecurity updates

Installed and secured before handover.

fastapi runthe production command in the docs
--workersstart several processes to use several cores
HTTPSfree Let's Encrypt on your domain
VPS-1runs a small API with PostgreSQL
01Why a VPS

Why Run FastAPI on a VPS

Serverless and free tiers add cold starts and limits. A VPS gives your API a process that stays up and a database next to it.

Always warm

Your workers are already running when the first request arrives.

Real concurrency

Uvicorn's workers use multiple cores: the docs' --workers option starts one process per worker.

Any database and cache

PostgreSQL, MySQL or Redis on the same server, or external.

Flat cost

One server cost, however many requests you serve.

02The stack

How a FastAPI Server Is Set Up

NGINX at the edge, Uvicorn running your app behind it.

  1. Reverse proxy

    NGINX

    HTTPS on your domain, forwarding requests to Uvicorn on localhost.

  2. Application server

    Uvicorn (uvicorn[standard])

    Runs your FastAPI app as a systemd service; the standard extra adds uvloop.

  3. Application

    Your FastAPI project

    Deployed into a virtual environment with its own settings and secrets.

  4. Database

    PostgreSQL (optional)

    A database and user for your API, reachable only from the server.

04 DATABASE PostgreSQL (optional) 03 APPLICATION Your FastAPI project 02 APPLICATION SERVER Uvicorn (uvicorn[standar… 01 REVERSE PROXY NGINX

Engineer's notes

  1. FastAPI's docs: fastapi run is the command to serve in production; --reload is for development only.
  2. Uvicorn takes --workers N to start N worker processes and use several cores.
  3. Keep Uvicorn on 127.0.0.1 and let NGINX face the internet.
  4. Each worker is a full copy of your app in memory: size workers to your RAM.
  • 443HTTPS, NGINX
  • 80HTTP, redirects to HTTPS
  • 22SSH, you only
  • 8000Uvicorn, localhost only
03Use cases

What You Can Run

A REST or JSON API

The classic FastAPI service behind NGINX.

An ML model endpoint

A small model served over HTTP (mind the CPU-only plans).

Webhook receivers

Endpoints for payment, chat and CI callbacks.

A backend for a mobile app

Auth, data and push logic.

Background workers

Queues and scheduled jobs beside the API.

A staging copy

A second app on the same server for testing.

04Sizing guide

Which Plan for Your FastAPI App

Workers, libraries and the database share the server memory.

Recommended start

VPS-1

2 vCores and 4 GB RAM; two workers fit comfortably.

vCores2
RAM4 GB
NVMe40 GB
See VPS-1
Recommended start

VPS-2

4 vCores and 8 GB RAM.

vCores4
RAM8 GB
NVMe75 GB
See VPS-2
Recommended start

VPS-3

6 vCores and 12 GB RAM.

vCores6
RAM12 GB
NVMe100 GB
See VPS-3
Recommended start

VPS-4

8 vCores and 24 GB RAM.

vCores8
RAM24 GB
NVMe200 GB
See VPS-4

A starting point, not a limit: every plan upgrades in place, keeping your data, IP address and configuration.

05After handover

Deploying Your FastAPI App

A first deployment, as your own user. Replace the names with yours.

  1. Create the environment and install packages

    Include uvicorn[standard] for the faster event loop.

    python3 -m venv .venv.venv/bin/pip install -r requirements.txt "uvicorn[standard]"
  2. Try it by hand

    Bind to localhost; main:app is module:variable.

    .venv/bin/uvicorn main:app --host 127.0.0.1 --port 8000
  3. Use several workers

    One worker process per core is a common start.

    .venv/bin/uvicorn main:app --host 127.0.0.1 --port 8000 --workers 2
  4. Run it as a service

    A systemd unit whose ExecStart is the command above, with Restart=on-failure.

    sudo systemctl daemon-reloadsudo systemctl enable --now myapi
  5. Check it end to end

    Through NGINX and HTTPS.

    curl -I https://api.example.com/docs

Example commands: adjust names, paths and versions to your project. Deploying and maintaining your application is yours to do, or ask us for a quote.

06Cheat sheet

FastAPI commands you will use every week

Copy, paste, adjust the names. Each one is safe to run as your own user on the server.

Restart the API

sudo systemctl restart myapi

Follow the log

sudo journalctl -u myapi -f

Is it listening?

ss -ltnp | grep 8000

Update packages

.venv/bin/pip install -U -r requirements.txt

Reload NGINX safely

sudo nginx -t && sudo systemctl reload nginx

Memory per worker

ps -o pid,rss,cmd -C uvicorn
07Compare

Serverless or FastAPI on a VPS?

Serverless scales to zero. A VPS stays warm at a flat cost.

Serverless platform

  • Cold startsPossible after idle time
  • PricingPer request and per second
  • Long jobs and connectionsTime limits apply
  • DatabaseSeparate service and latency
  • Server administrationHandled by the platform

FastAPI VPS

  • Cold startsNone: the process stays running
  • PricingFlat server cost
  • Long jobs and connectionsNo platform time limit
  • DatabaseOn the same server
  • Server administrationYours, after our free setup
Choose a VPS plan
08Handover

Your FastAPI stack

Free one-time setup before you get access. Here is what happens, and what you receive.

  1. Pick a plan and a location

    Resources that fit your workload, in the datacentre closest to your users.

  2. Tell us your FastAPI setup

    Versions, database and domain: at order or right after.

  3. We install and secure it

    Server hardened, the stack installed and tested, HTTPS on your domain.

  4. You get root

    SSH to a working server, ready for your code and data.

Installed for you

  • Python 3 with venv and pip, or the version you specify
  • A systemd service for Uvicorn running your app
  • NGINX reverse proxy with HTTPS on your domain
  • PostgreSQL or MySQL with a database and user, on request
  • Your FastAPI code and secrets are deployed by you

Secured before handover

  • Non-root sudo user created for daily work
  • SSH key login, password login for root disabled
  • Firewall (UFW) open only for the ports you use
  • Fail2ban blocking repeated login attempts
  • Automatic security updates enabled
  • Free Let's Encrypt SSL on your domain
  • Timezone, swap and hostname configured

Not included (we say so up front)

  • Ongoing server administration
  • Application maintenance and updates
  • Debugging your code
  • Migrating existing sites or data
09Hardening and tuning

Security and Performance for FastAPI

Security

  • Never run with --reload in production; the docs warn it costs resources and stability.
  • Keep secrets in environment variables, not in the repository.
  • Bind Uvicorn to localhost and let NGINX terminate HTTPS.
  • Keep Python packages updated; security fixes land often.

Performance

  • Size --workers to your cores and RAM, then load-test.
  • Install uvicorn[standard] for uvloop.
  • Use a connection pool for the database.
  • Cache expensive responses with Redis.

Built from the official documentation

VPS Plans

VPS Plans for FastAPI

VPS-1 runs a small API with a database. Choose VPS-2 or above for several workers, heavier libraries or a busier database.

VPS-1

Small websites, APIs, bots and development servers.

₹1,008 /mo
Get Started
  • 2 vCores
  • 4 GB RAM
  • 40 GB NVMe
  • 500 Mbps
  • Full root and SSH access
  • Free initial stack installation
  • Server hardening and firewall setup
  • Daily backup of the previous 24 hours
  • Unlimited traffic *
  • Anti-DDoS protection
  • Dedicated IPv4 and IPv6
  • KVM virtualisation

VPS-3

Busy stores, SaaS products and several projects.

₹2,748 /mo
Get Started
  • 6 vCores
  • 12 GB RAM
  • 100 GB NVMe
  • 2 Gbps
  • Full root and SSH access
  • Free initial stack installation
  • Server hardening and firewall setup
  • Daily backup of the previous 24 hours
  • Unlimited traffic *
  • Anti-DDoS protection
  • Dedicated IPv4 and IPv6
  • KVM virtualisation

VPS-4

High-traffic apps, large databases and agencies.

₹5,274 /mo
Get Started
  • 8 vCores
  • 24 GB RAM
  • 200 GB NVMe
  • 3 Gbps
  • Full root and SSH access
  • Free initial stack installation
  • Server hardening and firewall setup
  • Daily backup of the previous 24 hours
  • Unlimited traffic *
  • Anti-DDoS protection
  • Dedicated IPv4 and IPv6
  • KVM virtualisation

* Unlimited traffic in Europe and North America. In Mumbai, Singapore and Sydney a monthly allowance applies (VPS-1 500 GB, VPS-2/VPS-3 1 TB, VPS-4 3 TB), then speed is limited to 10 Mbps until the next month.

Prices exclude 18% GST, which is added to invoices for customers in India.

10Under the hood

Platform specs and locations

The same KVM platform on every plan; only CPU, RAM, storage and port speed change.

Virtualisation
KVM with reserved vCores and RAM
Storage
NVMe SSD on every plan
Network
Dedicated IPv4 and IPv6, 500 Mbps to 3 Gbps per plan
Operating systems
Ubuntu 26.04, 24.04 and 22.04 LTS · Debian 13, 12 and 11 · AlmaLinux · Rocky Linux · Fedora · FreeBSD
Access
Full root over SSH, key-based login
Backups
Automatic daily backup of the previous 24 hours; snapshots and longer retention on request
Protection
Always-on anti-DDoS mitigation
Availability
99.9% uptime SLA

Asia-Pacific

  • Mumbai
  • Singapore
  • Sydney

Europe

  • London
  • Limburg
  • Roubaix
  • Gravelines
  • Strasbourg
  • Milan
  • Warsaw

North America

  • Beauharnois

Availability per location changes with demand; we confirm your location before setup. In Mumbai, Singapore and Sydney each plan includes a monthly traffic allowance (VPS-1 500 GB, VPS-2 and VPS-3 1 TB, VPS-4 3 TB); beyond it, speed is limited to 10 Mbps until the next month.

FastAPI VPS FAQs

Questions before you deploy

Not covered here? Ask an engineer before you order.

Ready when you are

Put Your FastAPI App Live

Choose a plan and we hand over Python, Uvicorn, NGINX and HTTPS on a hardened server, ready for your code.