Deploy a FastAPI app to Wokku with Uvicorn workers and Postgres.
Prerequisites
- A Wokku account and a connected server
- An SSH key registered for
git push - A FastAPI app with
requirements.txt
1. Create the app
Apps → New App → server, name my-fastapi-app, box size, Create.
bash
wokku apps:create my-fastapi-app --server my-server
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.
bash
wokku config:set my-fastapi-app ENV=production
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
Connect under Apps → Connect GitHub for push-to-deploy —
see GitHub Auto-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. UvicornWorkernot found — adduvicorn[standard]torequirements.txt.- Async DB driver — use
asyncpg(notpsycopg) for async SQLAlchemy.