[{"data":1,"prerenderedAt":109},["ShallowReactive",2],{"seo-verification":3,"marketplace-app-en-fastapi":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"slug":7,"slugs":8,"categorySlugs":9,"name":13,"description":14,"phase":15,"unavailableReason":16,"docsUrl":17,"logo":18,"github":18,"tagline":19,"longDescription":20,"features":21,"useCases":29,"steps":39,"faq":55,"specs":71,"compatibleOs":82,"relatedApps":83,"relatedPosts":103,"category":106},"fastapi",{"fr":7,"en":7,"ar":7},{"fr":10,"en":11,"ar":12},"developpement","development","التطوير","FastAPI Stack","Python 3.12, Uvicorn, Gunicorn, Nginx and PostgreSQL 16 preconfigured. Deploy your FastAPI API to production in minutes.",2,"awaiting_qa","https:\u002F\u002Fservorbit.com\u002Fblog\u002Fdeploy-a-fastapi-application-on-a-vps",null,"Production-ready Python environment — FastAPI, Uvicorn, Gunicorn, Nginx, PostgreSQL 16.","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.\n\nFastAPI'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.\n\nThe 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 \u002Fdocs (Swagger UI) and \u002Fredoc so your API is self-documenting from day one.",[22,23,24,25,26,27,28],"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 — \u002Fdocs and \u002Fredoc available immediately for every endpoint you define.","Supervisor-ready — add a Supervisor config to keep Gunicorn and background workers alive after reboots.",[30,33,36],{"title":31,"body":32},"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.",{"title":34,"body":35},"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 \u002Fdocs interface so consumers can test endpoints without writing a client.",{"title":37,"body":38},"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.",[40,43,46,49,52],{"title":41,"body":42},"Order a ServOrbit VPS","A 1 GB RAM VPS on Ubuntu 24.04 is enough for a FastAPI API without heavy I\u002FO. 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.",{"title":44,"body":45},"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.",{"title":47,"body":48},"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.",{"title":50,"body":51},"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\u002F443 to port 8000 and handles HTTPS.",{"title":53,"body":54},"Enable HTTPS and access \u002Fdocs","Run `certbot --nginx -d your-domain.com` to get a free Let's Encrypt certificate. Your API is then reachable at https:\u002F\u002Fyour-domain.com and the interactive documentation at https:\u002F\u002Fyour-domain.com\u002Fdocs.",[56,59,62,65,68],{"q":57,"a":58},"What is the difference between FastAPI and Django for an API?","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.",{"q":60,"a":61},"How do I configure Gunicorn with Uvicorn?","Use Gunicorn as the process manager with the UvicornWorker: `gunicorn main:app -k uvicorn.workers.UvicornWorker --workers 4 --bind 127.0.0.1:8000`. The recommended number of workers is (2 × vCPU) + 1. This gives you Gunicorn's process management (restart on crash, graceful reload) and Uvicorn's async performance.",{"q":63,"a":64},"Can I use FastAPI without PostgreSQL?","Yes. FastAPI has no database dependency. Use SQLite, MySQL, MongoDB, or any database via SQLAlchemy (sync or async) or Motor for MongoDB. The stack installs PostgreSQL 16 for projects that need it — you can ignore it if you start on a different database.",{"q":66,"a":67},"How do I access the Swagger documentation of my API?","FastAPI automatically generates \u002Fdocs (Swagger UI) and \u002Fredoc (ReDoc) for every endpoint you define. Access https:\u002F\u002Fyour-domain.com\u002Fdocs after deployment. In production, restrict or protect these endpoints with an HTTP basic-auth middleware or a router prefix if the API is not public.",{"q":69,"a":70},"What is the minimum recommended RAM?","1 GB for a lightweight API without a database. Plan for 2 GB with PostgreSQL on the same VPS, 4 GB for Celery workers or concurrent model inference. Each Uvicorn\u002FGunicorn worker uses approximately 50–150 MB depending on the data loaded at startup.",{"ram":72,"cpu":73,"stack":74},"1 GB","1 vCPU",[75,76,77,78,79,80,81],"Python 3.12","Uvicorn","Gunicorn","Nginx","PostgreSQL 16","pip","virtualenv",[],[84,92,98],{"name":85,"slug":86,"categorySlug":11,"categoryName":87,"categoryColor":88,"logo":89,"tagline":90,"description":91},"Laravel Stack","laravel-stack","Development","text-warning bg-warning\u002F10","https:\u002F\u002Fcdn.simpleicons.org\u002Flaravel","PHP-FPM, Nginx, PostgreSQL, Redis and Supervisor — a production-ready Laravel stack from the moment you order.","PHP-FPM, Nginx, PostgreSQL, Redis and Supervisor preconfigured. Deploy Laravel to production with no initial configuration.",{"name":93,"slug":94,"categorySlug":11,"categoryName":87,"categoryColor":88,"logo":95,"tagline":96,"description":97},"Node.js Stack","nodejs-stack","https:\u002F\u002Fcdn.simpleicons.org\u002Fnodedotjs","Node.js, PM2, Nginx and a database — a production environment for your JavaScript APIs and apps.","Node.js with PM2, an Nginx reverse proxy and a database. Your JavaScript APIs and applications ready to take traffic.",{"name":99,"slug":100,"categorySlug":11,"categoryName":87,"categoryColor":88,"logo":18,"tagline":101,"description":102},"Django Stack","django","Production-ready Python environment — Django, Gunicorn, Nginx, PostgreSQL 16.","Python 3.12, Gunicorn, Nginx and PostgreSQL 16 preconfigured. Deploy your Django application to production in minutes, no manual server setup.",[104,105],"deployer-fastapi-vps","deployer-django-vps",{"key":10,"slug":11,"name":87,"objective":107,"icon":108,"color":88},"Kick off a software project quickly.","dev",1787581039077]