Framework Frankfurt, Germany
Deploy FastAPI on Nodion
Nodion recognizes FastAPI or Starlette in your dependencies, installs them with its Python buildpack and starts Uvicorn on your main.py or app.py. Migrations can run as a release step before each new version goes live, and the API runs in Frankfurt, next to a managed PostgreSQL database if you need one.
- Detected by
- FastAPI or Starlette in your dependencies
- Start
uvicorn main:app, one process- Python
- 3.10 to 3.15, default 3.13
- Region
- EU Central (Frankfurt)
Deploy FastAPI step by step
- Install FastAPI with Uvicorn Nodion starts Uvicorn but does not install it.
fastapi[standard]includes it; with plainfastapi, adduvicornyourself. Pin the Python version in.python-version, because a range picks the newest release. requirements.txtfastapi[standard] - Keep the app in main.py or app.py Nodion takes whichever of
main.pyandapp.pycontainsFastAPIorStarletteand runsuvicorn main:apporuvicorn app:appon0.0.0.0and thePORTit sets. Answer/with a 200: it is the default health check path. main.pyfrom fastapi import FastAPI app = FastAPI() @app.get("/") def root(): return {"status": "ok"} - Package layout? Add a web line If your app lives in a package such as
app/main.py, there is no root file to find. Name the module yourself in a Procfile; the line replaces the default start command. Procfileweb: uvicorn app.main:app --host 0.0.0.0 --port $PORT - Run migrations on every deploy With Alembic, a
release:line runs once per build, after the build and before the new version starts. If it fails, the deploy stops and the running version stays live. Procfilerelease: alembic upgrade head - Create the app and the database Create an application from your repository in the region EU Central, then a PostgreSQL database in the same region, and attach it on the Environment tab: it arrives as
DATABASE_URLon the next deploy. Mark API keys as secret, then push.
Good to know
- TrustedHostMiddlewareNodion's health check calls each instance by its internal address, which is not in
allowed_hosts, so the middleware answers 400 and the release never goes live. Add an@app.middleware("http")function after it that returns 200 for/healthz(Starlette runs the middleware added last first), and set/healthzas the health check path in the app settings. - More than one workerThe default is a single Uvicorn process. For more, set
web: uvicorn main:app --host 0.0.0.0 --port $PORT --workers 2in a Procfile, or run more instances of the web process. - DATABASE_URL and SQLAlchemyNodion's
DATABASE_URLstarts withpostgres://, which SQLAlchemy 1.4 and newer do not accept. Replace the scheme before you pass it on, for example withpostgresql+psycopg://for psycopg 3, which works for sync and async engines.
What Nodion runs for you
- Deploys without downtime Push to your branch and Nodion builds a new release. Traffic switches once the new instances answer their health check; a failed release leaves the running one in place. Apps with a local volume restart instead, because the disk belongs to one instance.
- Databases next to the app Managed PostgreSQL, pgvector, MySQL, Valkey and ClickHouse in the same region. Attached databases arrive as
DATABASE_URL,REDIS_URLorCLICKHOUSE_URL. - Previews per pull request Turn on previews and pull requests from your repository get their own app with its own URL and fresh, empty databases, created automatically or by hand. Forks and bot pull requests are skipped.
- Workers, cron jobs and scaling Run workers as extra processes of the same app, schedule jobs on the Cron tab, and scale every process to up to 16 instances.
- Release step With buildpacks, a Procfile
release:line runs with every new build. Dockerfile apps, and redeploys or rollbacks to an earlier image, use a release command set on the app itself, which also takes precedence over the Procfile line. On static sites a release step runs in an image that holds only the built files. - Logs and metrics Build, release and runtime logs plus CPU, memory, disk and network metrics for every instance in the dashboard.
- Domains and HTTPS A default hostname with HTTPS from the first deploy; your own domains get certificates automatically.
Further reading
- Preview Environments Explained: An App per Pull Request A running copy of your app for every pull request: what preview environments are good for, where they get tricky and how Nodion handles them.
- Render Alternatives in Europe: 5 Options Compared Web service, background workers and Postgres in Europe: five Render alternatives compared by how they run workers and manage Postgres.
FastAPI on Nodion: questions and answers
Does Nodion run FastAPI with several workers?
Not by default: Nodion starts one Uvicorn process. Add --workers 2 or more to your own web: line, or scale the web process to more instances.
Why does my FastAPI deploy never become ready?
The health check needs a 2xx or 3xx on /. An API without a root route answers 404, and TrustedHostMiddleware answers 400 to the internal address. Add a route, or set a path such as /healthz in the app settings and answer it before the host check.
Do Starlette apps work too?
Yes. Starlette in your dependencies gets the same Uvicorn default, which looks for app in main.py or app.py.
Where does my FastAPI app run?
In the EU Central region in Frankfurt, Germany. Build, registry, the app and its databases, volumes, buckets, logs and metrics stay in that region, and Nodion's API and control plane are hosted in Germany. Nodion GmbH is based in Stuttgart.
Can I use FastAPI in line with the GDPR?
Nodion provides the basis for it: Nodion GmbH is based in Stuttgart, Germany, in the Frankfurt region the app, its databases and volumes run in Germany, and you conclude the data processing agreement (DPA) under Art. 28 GDPR electronically in the dashboard. Whether your setup complies also depends on how you configure and use the app.
How much does it cost to run FastAPI on Nodion?
An app instance starts at 1 EUR per month. The setup in the cost box costs 3.50 EUR per month: App 2 EUR, PostgreSQL 1.50 EUR. Prices are net and billed per second, and you pick bigger sizes or more instances whenever you need them.
Can I use my own domain for my FastAPI app?
Yes. Every app gets a default hostname with HTTPS. Add your own domain on the app's Domains tab; the TLS certificate is issued and renewed automatically.