FastAPI from repo to HTTPS endpoint in one deploy
We look for FastAPI( in main.py, app.py, app/main.py, src/main.py or api/main.py, turn the file path into a module path and start uvicorn on port 8000. Your interactive docs at /docs work on staging immediately. The only rule is that the FastAPI instance must be called app.
Free staging (0.25 vCPU · 256 MB · 1 GB) · Live from ₹118.50/month, billed hourly · No servers to manage
Sensible FastAPI defaults, no config files.
When you connect the repository we read it and fill in the build settings below. Every value can be changed in the app’s settings — see build settings.
- Runtime
- Python 3.12
- Port
- 8000
- Build command
- pip install -r requirements.txt
- Start command
- uvicorn main:app --host 0.0.0.0 --port 8000 (app/main.py becomes app.main:app)
Deploy FastAPI in minutes.
- 1
Name the instance app
Write
app = FastAPI()at module level. If you call itapior build it in a factory, set Start command yourself. - 2
List your dependencies
Include
fastapiand your libraries inrequirements.txt.uvicorn[standard]is installed automatically when the start command uses uvicorn. - 3
Add a health endpoint
Add
@app.get('/health')returning{'ok': True}and set Health check path to/health. - 4
Create and deploy
In New app pick your repo; we detect FastAPI and fill in the uvicorn command. Open
/docson the staging address to try your endpoints. - 5
Go live
Click Go live and point your front end at the live address or a custom domain like
api.yourdomain.com.
Running FastAPI well in production.
Staging is free
Every app gets a staging copy in a free, lightweight Docker container (0.25 vCPU · 256 MB · 1 GB). It pauses after 7 days without a deploy — one click starts it again.
- Any HTTP status below 500 counts as healthy, so a 404 on
/will not block a release — but a dedicated/healthroute makes failures easier to read. - For more throughput on live, override Start command with
uvicorn main:app --host 0.0.0.0 --port 8000 --workers 2(match workers to your vCPUs), or use gunicorn with-k uvicorn.workers.UvicornWorker. - Configure CORS with
CORSMiddlewareand list both your staging and live front-end origins. - Put
pydantic-settingsto work readingDATABASE_URLand secrets from environment variables, which you set separately for staging and live. - Heavy model loading at import time can exceed the 90-second start window or the 256 MB staging memory. Load lazily, or size live up in Settings.
Trigger
git push
Promote
same image
Rollback
1 click
FastAPI questions.
My app object is called api. What do I do?
Set Start command to `uvicorn main:api --host 0.0.0.0 --port 8000`. Detection only recognises a variable named `app`.
Do WebSockets work?
FastAPI runs under uvicorn with the standard extras, which include WebSocket support. Try your WebSocket routes on staging before going live.
Can I disable /docs on live?
Yes. Create the app with `FastAPI(docs_url=None)` when an environment variable like `ENV=live` is set, and set that variable only on live.
Ship your FastAPI app today.
Create an account, connect your repository and get a free staging copy plus a live HTTPS address in minutes.