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, served by uvicorn) or Flask (WSGI, served by gunicorn). The platform creates a Python virtual environment, installs dependencies from requirements.txt, finds your FastAPI() or Flask() app in the code and starts it on the right port. If your requirements.txt does not pin gunicorn, it is installed for a Flask app. 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. Public and private repositories both work. For a private one, create a GitHub token with the repo scope and paste it into the GitHub token field when you deploy; leave that field empty for a public repository.

How to do it

  1. Want to see it work first? Deploy one of our starters from the public repository https://github.com/cirro-admin/cmcloudhosting-demo: Subdirectory python-fastapi with Runtime python_fastapi, or python-flask with Runtime python_flask. Each README lists every field, and once it runs you have a working reference for your own app.
  2. Purchase an App Hosting plan or start a free trial from the Services page.
  3. Push your Python project to a GitHub repository with app.py or main.py at the root.
  4. Include a requirements.txt file listing all dependencies (fastapi, uvicorn, flask, gunicorn, etc.).
  5. Ensure your app reads its port from the $PORT environment variable.
  6. Navigate to Portal → Services and open your App Hosting service.
  7. Set Action to Deploy Python app and Runtime to python_fastapi (for FastAPI/uvicorn) or python_flask (for Flask/gunicorn).
  8. Paste your GitHub repository URL into the Artifact Reference field.
  9. Leave the Start Command field empty. We find your FastAPI() or Flask() instance in the code, including nested layouts such as app/main.py, and start it with uvicorn (FastAPI) or gunicorn (Flask) on the right port. Only fill it in if your app starts some other way; to go back to the default later, empty the field and redeploy.
  10. Click Redeploy App. The platform creates a virtualenv and runs pip install -r requirements.txt.
  11. Need a database? Add managed PostgreSQL from your service page and pass DATABASE_URL to your app as an environment variable (see Connect your app to PostgreSQL), or run a PocketBase backend as a separate service.
  12. Visit your assigned domain to verify your API is responding.

Starter code and references

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