Deployka / FastAPI hosting
Hosting for FastAPI and Python APIs
Need stable HTTPS for FastAPI, a webhook, or a Mini App backend? Upload the project — Deployka picks up Python, dependencies, and the start command. Logs and restart stay in the dashboard.
What this page covers
- uvicorn / gunicorn
- PORT and 0.0.0.0
- requirements.txt
- health check
- webhook + logs + restart
How to deploy
- ZIP or GitHub with requirements.txt / pyproject.toml and an entrypoint (uvicorn / gunicorn).
- Set ENV (secrets, DATABASE_URL) — we configure PORT automatically.
- Deploy → install deps → process listens on PORT → HTTPS URL + logs.
Minimal main.py
Add fastapi and uvicorn to requirements.txt for this example. /health checks the process response, not database or third-party API availability.
from fastapi import FastAPI
app = FastAPI()
@app.get("/health")
def health():
return {"status": "ok"}Procfile and start command
main:app refers to the app object in main.py. Adjust the import path for a different structure. PORT comes from ENV; do not use --reload in production.
web: uvicorn main:app --host 0.0.0.0 --port $PORTENV you need
- PORT — your uvicorn/--port (or env) must use it.
- API keys, BOT_TOKEN, DATABASE_URL — dashboard secrets.
- CORS / ALLOWED_ORIGINS — if the frontend is on another domain.
Package managers and stack
- pip + requirements.txt
- Poetry / pip-tools — when the lockfile is clear to the builder
Common failures
- ModuleNotFoundError — deps missing from requirements or the environment was not reproduced.
- Connection refused / health check failed — the app is not listening on 0.0.0.0:$PORT.
- Crash on boot from ENV — Deploy Doctor flags missing keys before the build.
Pricing
Small API — Node Micro / similar plans from $3.29/mo. Heavier FastAPI / Mini App backends — MVP App at $13.08/mo.
Useful links
Code ready. Deployka runs it.