Deploy FastAPI / Python
How nesly detects, builds and serves a FastAPI / Python project — and the two commands that put it on a live URL.
Deploy FastAPI / Python on nesly
A FastAPI / Python project is built into a container and run as a server process.
nesly new python-fastapi my-app
cd my-app
nesly deploy --yes
The first deploy creates the project and prints the live URL; after that,
nesly deploy is enough.
The python-fastapi template is a complete,
readable starting point.
How detection sees it
- A Python project (requirements.txt, pyproject.toml) runs as a container.
- The start command belongs in nesly.toml next to the code — config as code, reviewed in the same PR as the change it runs.
When detection is not what you want, say it yourself: build and start commands, root
directory and output directory live in nesly.toml
committed next to the code — see builds.
Worth knowing
- uvicorn must be told the platform's port: --host 0.0.0.0 --port $PORT.
- Put start under the [build] section of nesly.toml — a top-level key is ignored, with a warning in the build log.
-
Attach a managed database with
nesly addon add postgres(ormssql) — connection env vars are injected on the next deploy. -
When a deploy fails,
nesly diagnosereads the logs for you and names the fix.
Full walkthrough: get started. Custom domains, backups, GitHub deploys and the rest of the reference: nesly CLI.