w wokku
Get Started
~/docs
/
frameworks

# Deploy FastAPI

Updated · Edit on GitHub ↗

Deploy a FastAPI app to Wokku with Uvicorn workers and Postgres.

Prerequisites

1. Create the app

Apps → New App → server, name my-fastapi-app, box size, Create.

2. Prepare your FastAPI app

text
# requirements.txt
fastapi
uvicorn[standard]
gunicorn
psycopg[binary]

Add a Procfile (assuming app is your FastAPI instance in main.py):

procfile
web: gunicorn main:app -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:$PORT
// note

3. Set environment variables

App → Config → add any secrets/config your app reads from the env.

4. Add a database (optional)

bash
wokku addons:create postgres my-fastapi-app

Read os.environ["DATABASE_URL"] (SQLAlchemy/SQLModel/asyncpg). See
Create & Link a Database.

5. Deploy

bash
git remote add wokku git@git.wokku.cloud:my-fastapi-app
git push wokku main

Live at https://my-fastapi-app.wokku.app — docs at /docs (Swagger UI).

Custom domain

Custom Domains — SSL is automatic.

Troubleshooting

  • 502 / no response — make sure the bind uses $PORT, not a fixed port.
  • UvicornWorker not found — add uvicorn[standard] to requirements.txt.
  • Async DB driver — use asyncpg (not psycopg) for async SQLAlchemy.

Next steps

Was this page helpful?