Framework Frankfurt, Germany
Deploy Flask on Nodion
Nodion recognizes Flask in your dependencies, installs them with its Python buildpack and starts Gunicorn with three workers on your app object. Migrations can run as a release step before each new version goes live, and the app runs in Frankfurt, next to a managed PostgreSQL database if you need one.
- Detected by
- Flask in your dependencies
- Start
gunicorn app:app, 3 workers- Python
- 3.10 to 3.15, default 3.13
- Region
- EU Central (Frankfurt)
Deploy Flask step by step
- Add Gunicorn to your dependencies Nodion starts Gunicorn but does not install it, so list it next to Flask. Pin the Python version in
.python-version, because a range inpyproject.tomlpicks the newest release. requirements.txtflask gunicorn - Keep the app object in app.py Nodion takes the first of
app.py,application.pyandwsgi.pythat containsFlaskand runsgunicorn <file>:appwith 3 workers on thePORTit sets. The object has to be calledapp. app.pyfrom flask import Flask app = Flask(__name__) @app.get("/") def index(): return "Hello from Frankfurt" - Using an app factory? Add a web line With
create_app()there is no module-levelappto find, so tell Gunicorn to call the factory in a Procfile. The line replaces the default start command. Procfileweb: gunicorn "myapp:create_app()" --bind 0.0.0.0:$PORT --workers 3 - Run migrations on every deploy With Flask-Migrate, a
release:line runsflask db upgradeonce per build, after the build and before the new version starts. If it fails, the deploy stops and the running version stays live. Procfilerelease: flask --app myapp db upgrade - 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. Set yourSECRET_KEYas a secret variable, read it withos.environ, then push.
Good to know
- 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:postgresql://for psycopg2,postgresql+psycopg://for psycopg 3. - Health checkTraffic switches once
/answers with 2xx or 3xx, so a redirect to a login page is fine. If/returns 401 or 404, add a route such as/healthzand set it as the health check path in the app settings. - Celery and RQ workersAdd
worker: celery -A myapp workerto the Procfile together with an explicitweb: gunicorn app:app --bind 0.0.0.0:$PORT --workers 3; without aweb:line the first Procfile entry other thanrelease:becomes the default command. Then add a process namedworkerwithout a port on the Processes tab. Valkey in the same region gives youREDIS_URL.
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
- Heroku Alternatives with EU Hosting: 5 Options Compared A German platform and US clouds with EU regions, compared by headquarters, regions and managed databases.
- 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.
Flask on Nodion: questions and answers
Why does my Flask app not start?
Usually Gunicorn is missing from your dependencies, the object is not called app, or the app is built in a factory. Add gunicorn, rename the object, or set a web: line that calls create_app().
Does Nodion use flask run or app.run()?
No. With Flask in your dependencies, Nodion starts Gunicorn. Flask's built-in server is meant for development, so keep app.run() under if __name__ == "__main__": for local use.
How many Gunicorn workers do I get?
Three by default. Set your own number with --workers in a web: line, and run more instances of the web process when one is not enough.
Where does my Flask 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 Flask 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 Flask 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 Flask 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.