Kick off a software project quickly.

FastAPI Stack

Production-ready Python environment — FastAPI, Uvicorn, Gunicorn, Nginx, PostgreSQL 16.

1 GB RAM 1 vCPU In validation

In validation

Automatic installation for this solution is ready and currently going through our tests on a real server. Ordering will open as soon as validation is complete.

Tech stack

Python 3.12UvicornGunicornNginxPostgreSQL 16pipvirtualenv
Minimum RAM1 GB
Minimum CPU1 vCPU
Compatible OSChoice of Linux distributions

FastAPI Stack provisions your VPS with everything a FastAPI application needs in production: Python 3.12 (deadsnakes PPA), Uvicorn as the ASGI server driven by Gunicorn, Nginx as the reverse proxy, and PostgreSQL 16 as the database. No manual package configuration, no buildpack constraints — clone your repository, start Uvicorn, and your API is live.

FastAPI's async-first design means your API handles WebSocket connections, Server-Sent Events, and hundreds of concurrent requests without spawning a thread per request. Gunicorn manages multiple Uvicorn workers with automatic restart on failure, Nginx handles TLS termination and static-file serving, and PostgreSQL 16 backs any data model your project requires.

The stack mirrors a production-proven setup: Supervisor keeps Gunicorn alive after reboots, virtualenv isolates your project dependencies, and Pydantic's schema validation is available from the first endpoint. FastAPI auto-generates /docs (Swagger UI) and /redoc so your API is self-documenting from day one.

Key features

Python 3.12 from the deadsnakes PPA — latest stable release, fully compatible with FastAPI, Pydantic v2, and SQLAlchemy 2.
Uvicorn ASGI server with Gunicorn workers — async-native, handles WebSockets and SSE; Gunicorn manages worker lifecycle and automatic restarts.
Nginx reverse proxy — TLS termination, static-file serving, gzip compression, WebSocket upgrade headers configured out of the box.
PostgreSQL 16 — first-class async support via asyncpg; JSONB columns, full-text search, advanced query planner.
pip and virtualenv — dependency isolation per project, reproducible installs across environments.
Swagger UI and ReDoc auto-generated — /docs and /redoc available immediately for every endpoint you define.
Supervisor-ready — add a Supervisor config to keep Gunicorn and background workers alive after reboots.

When to use this solution?

1

REST API or microservice

Deploy a FastAPI application as a standalone REST API or microservice. Uvicorn handles async requests, Nginx terminates TLS, and PostgreSQL backs your data model. Add Redis for caching or rate limiting without changing the deployment structure.

2

AI and ML API backend

Serve a machine-learning model via HTTP with FastAPI's async request handling. Load the model once at startup, serve predictions concurrently across Uvicorn workers, and expose a /docs interface so consumers can test endpoints without writing a client.

3

Backend for a SPA or mobile app

Host the API layer for a React, Vue, or mobile frontend. FastAPI handles CORS natively, Pydantic validates every incoming payload, and the OpenAPI schema can be exported to generate typed clients for TypeScript or Swift automatically.

Deploy FastAPI Stack on your VPS

Guide optimized for ServOrbit Cloud VPS.

01

Order a ServOrbit VPS

A 1 GB RAM VPS on Ubuntu 24.04 is enough for a FastAPI API without heavy I/O. Choose 2 GB if you run PostgreSQL on the same VPS, 4 GB for Celery workers or concurrent ML inference. The FastAPI Stack template is available in the marketplace order form.

02

Deploy from the marketplace

Go to Marketplace → Development → FastAPI Stack and click Deploy. The provisioning script installs Python 3.12, Uvicorn, Gunicorn, Nginx, and PostgreSQL 16 automatically — no SSH session required for the base setup.

03

Clone your project and configure

SSH into the VPS, clone your repository, create a virtualenv (python3.12 -m venv venv), install dependencies (pip install -r requirements.txt), and set environment variables (DATABASE_URL, SECRET_KEY, ALLOWED_ORIGINS) in a .env file.

04

Start Uvicorn with Gunicorn

Start the application with gunicorn main:app -k uvicorn.workers.UvicornWorker --bind 127.0.0.1:8000 --workers 4. The number of workers is typically (2 × vCPU) + 1. Nginx proxies port 80/443 to port 8000 and handles HTTPS.

05

Enable HTTPS and access /docs

Run certbot --nginx -d your-domain.com to get a free Let's Encrypt certificate. Your API is then reachable at https://your-domain.com and the interactive documentation at https://your-domain.com/docs.

Frequently asked questions

FastAPI is async-native with Pydantic validation and auto-generated OpenAPI documentation — ideal for REST APIs and microservices. Django is a full-stack framework with a built-in admin, ORM, and template engine — better suited for monolithic web applications. For a pure API backend, FastAPI is faster to develop and faster at runtime.

Kick off a software project quickly.

FastAPI Stack isn't orderable yet.

Automatic installation for this solution is ready and currently going through our tests on a real server. Ordering will open as soon as validation is complete.

Need help?

Browse our help center and FAQ, or reach our team — callback, WhatsApp or email. Support in French, English and Arabic.