LanguageGB
App Deployment

Deploy a Python app (FastAPI / Flask)

Python apps run inside an isolated virtualenv. The platform installs requirements and starts your ASGI or WSGI server.

What this covers

Python apps on the platform run FastAPI (ASGI via uvicorn) or Flask (WSGI via gunicorn). The platform creates a Python virtual environment, installs dependencies from requirements.txt, and starts your app with the command you provide. Your entry file must be app.py or main.py in the repository root. No database is provisioned automatically. Django is a separate runtime with its own migration and static-file handling — see Deploy a Django app.

Before you start

Your repository must contain app.py or main.py at the root, and a requirements.txt listing all dependencies including uvicorn or gunicorn. Your app must read the port from the $PORT environment variable. You do not need a start command: we locate your FastAPI() or Flask() app in the code and set the port ourselves.

How to do it

  1. Purchase an App Hosting plan or start a free trial from the Services page.
  2. Push your Python project to a public GitHub repository with app.py or main.py at the root.
  3. Include a requirements.txt file listing all dependencies (fastapi, uvicorn, flask, gunicorn, etc.).
  4. Ensure your app reads its port from the $PORT environment variable.
  5. Navigate to Portal → Services and open your App Hosting service.
  6. Set Action to Deploy Python app and Runtime to python_fastapi (for FastAPI/uvicorn) or python_flask (for Flask/gunicorn).
  7. Paste your GitHub repository URL into the Artifact Reference field.
  8. Leave the Start Command field empty. We find your application object by scanning the code for the FastAPI() or Flask() instance — which handles nested layouts such as app/main.py — and fall back to main.py, server.py or app.py for a flat repository. The port is injected for you. ⚠️ Anything you type here overrides that, so only fill it in if your entry point cannot be found that way.
  9. Click Redeploy App. The platform creates a virtualenv and runs pip install -r requirements.txt.
  10. No database is provisioned automatically. If your app needs one, deploy PocketBase as a separate service, or connect an external database by adding your own environment variables.
  11. Visit your assigned domain to verify your API is responding.

What our team checks

Support verifies the repository structure, entry file detection, requirements installation, start command syntax, and health path response after startup.

Next step

Prepare your repository with app.py and requirements.txt, then open the deploy form on your service page.

Contact Support