Deploy FastAPI + PostgreSQL on Deployxa.

Deploy FastAPI with a managed PostgreSQL database, Alembic migrations, Uvicorn workers and HTTPS.

All frameworks

01 / Quickstart

Deploy from your terminal.

Install the CLI and deploy the FastAPI + PostgreSQL project in your current directory, or connect the repository in the console for push-to-deploy.

  • Typical database: Managed PostgreSQL
  • Build and start commands can be overridden
  • Secrets stay out of build logs
deploy · fastapi-postgresql
$ npm install -g @deployxa/cli$ deployxa login$ deployxa deploy

02 / Guide

How FastAPI + PostgreSQL goes to production.

  1. 01 /

    Connect the repository

    Deployxa finds your Python project and sets up the runtime.

  2. 02 /

    Add PostgreSQL

    Provision a managed PostgreSQL database; DATABASE_URL is injected.

  3. 03 /

    Migrate

    Alembic migrations run before the new release takes traffic.

  4. 04 /

    Go live

    The API and its OpenAPI docs are served over HTTPS.

03 / Configuration

Environment variables.

Set these in project settings. Values are never written to build logs.

Recommended environment variables for FastAPI + PostgreSQL
VariablePurposeExample
DATABASE_URLAsync connection stringpostgresql+asyncpg://...
SECRET_KEYToken signing key...
CORS_ORIGINSAllowed browser originshttps://app.example.com

04 / Included

What every deploy gets.

  • Stack detection

    Deployxa reads your repository and picks the runtime, build and start commands. Override any of them in project settings.

  • Isolated builds

    Every push builds in its own sandbox with cached dependencies and layers.

  • Managed databases

    Attach PostgreSQL, MySQL or Redis and the connection details are injected as environment variables.

  • HTTPS by default

    Every deploy gets a deployxa.online URL with a Let's Encrypt certificate; custom domains too.

  • Health-checked releases

    Traffic only switches to a release that passes its health check, and earlier releases stay available for rollback.

  • Push to deploy

    Connect GitHub, GitLab or Bitbucket and each push to your branch ships a new release.

05 / FAQ

FastAPI + PostgreSQL questions.

Does the database share a network with the app?

The connection string points the app at its managed database; credentials are injected, not committed to your repository.

Ready when you are

Ship your FastAPI + PostgreSQL app.

Connect a repository and get a live HTTPS URL.

See pricing