Open Editor →

Start Commands

A comprehensive reference for configuring your web application. Find the exact command and port for your framework of choice.

The Deployment Matrix

Configuring your app requires two values in the Hosting Dashboard: the Start Command (what runs in the terminal) and the Internal Port (where the app listens).

The commands below assume your main python file is named main.py or your application instance is named app. If your file is named differently (e.g., server.py), you must adjust the command accordingly.

Framework Recommended Start Command Internal Port
Flask python -m flask --app main run 5000
Django python manage.py runserver 8000
FastAPI python -m uvicorn main:app 8000
Starlette python -m uvicorn main:app 8000
Pyramid pserve development.ini 6543
Masonite python craft serve 8000
Sanic sanic main:app 8000
Litestar uvicorn main:app 8000
AIOHTTP python main.py 8080
Tornado python main.py 8888
Falcon gunicorn main:api 8000
Bottle python main.py 8080
Data & Dashboarding
Streamlit streamlit run main.py --server.headless true 8501
Gradio python main.py 7860
Dash python main.py 8050
Panel panel serve main.py 5006
NiceGUI python main.py 8080
Reflex reflex run 3000
Flet flet run main.py --web --port 8000 8000
Anvil anvil-app-server --app AppName 3030
Native & Static
Static Site python -m http.server 8000
Raw Socket python main.py 8000

Framework Specific Nuances

Production vs. Development Engines

Commands like flask run or python manage.py runserver use built-in development servers. These are excellent for testing but are notoriously bad at handling concurrent web traffic.

For Pro Tier users expecting real-world traffic, we highly recommend launching your application via a robust WSGI/ASGI server like Gunicorn or Uvicorn with multiple workers.

  • Flask Production: gunicorn -w 4 main:app
  • Django Production: gunicorn myproject.wsgi:application

Streamlit Requirements

Streamlit is designed to be interactive and often attempts to open a browser window automatically when it starts. In a cloud container, this will cause the deployment to crash. You must include the --server.headless true flag to suppress this behavior.

Reflex & Flet Initialization

  • Reflex: This framework requires scaffolding. You must open the Pro Terminal and run reflex init once to generate the necessary files before you can successfully deploy with reflex run.
  • Flet: By default, Flet tries to open a native desktop application window. You must explicitly instruct it to serve to the browser by using the --web flag, and provide the port argument so it aligns with the dashboard configuration.

Hosting Static HTML

You don't need a heavy framework to host a simple HTML portfolio or documentation site. Python includes a highly capable HTTP server in its standard library. Simply ensure your main file is named index.html (not `main.py`) and use python -m http.server.