Language Frankfurt, Germany

Deploy Java on Nodion

Nodion recognizes a Java project by pom.xml, build.gradle or a Maven or Gradle wrapper. The Java buildpack builds it with a Temurin JDK, skips the tests and starts the largest jar with java -jar on a Temurin JRE, so the JDK stays out of the run image. The app runs in Frankfurt, next to a managed PostgreSQL database if you need one.

Deploy to Nodion ›

from 1 EUR / month

Up to 15 € credit when signing up

Detected by
pom.xml, build.gradle(.kts), mvnw or gradlew
Start
java -Dserver.port=$PORT -jar with the largest jar
Java
Temurin 11, 17, 21 (default), 25, 26, 27
Region
EU Central (Frankfurt)

Deploy Java step by step

  1. Commit the Maven or Gradle wrapper With gradlew, Nodion runs ./gradlew build -x test --no-daemon; with mvnw, it runs ./mvnw -B -DskipTests clean package. A pom.xml without a wrapper builds with Nodion's own Maven. A Gradle project without gradlew fails, so create the wrapper with gradle wrapper and commit it together with the gradle/wrapper folder. Tests are skipped during the deploy; run them in your CI.
  2. Pin the Java version Without a pin, Nodion builds and runs with Java 21. Name another version in system.properties. Toolchain settings in pom.xml or your Gradle build are not read, so keep them in line with this file. system.properties
    java.runtime.version=25
  3. Listen on PORT Nodion sets PORT for the web process and passes it to the JVM as -Dserver.port, which covers Spring Boot. Other frameworks, or your own server, read PORT themselves and bind to 0.0.0.0.
    int port = Integer.parseInt(System.getenv().getOrDefault("PORT", "8080"));
  4. Create the app In the dashboard, create an application from your GitHub, GitLab, Bitbucket or Gitea repository, pick the branch, the region EU Central and a size with at least 1 GB of memory. Keep the build strategy on Buildpacks; if the repository has a Dockerfile, the form picks Dockerfile instead.
  5. Connect a database and migrate Attach a PostgreSQL database from the same region on the Environment tab. DATABASE_URL is a postgres:// URL, not a JDBC URL, so also inject host, port, database, user and password under your own names and build the JDBC URL from them, as the Spring Boot guide shows. Migrations that run at startup (Flyway, Liquibase) need nothing else; any other command can run from a release: line in a Procfile, once per build before the new version starts.

Good to know

  • MemoryThe JVM gets JAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=80.0 by default, so the heap may use most of the instance's memory. Set JAVA_TOOL_OPTIONS yourself to replace it, or JAVA_OPTS to add flags to the start command. Most JVM web apps want 1 GB or more.
  • Which jar startsNodion starts the largest jar directly in target/ or build/libs/ and skips -plain, -sources and -javadoc jars. In a multi-module build the runnable jar sits in a module folder; start it with a web: line in a Procfile and pass the port yourself.
  • Quarkus and other frameworks-Dserver.port only configures Spring Boot. Quarkus, Micronaut and others need their own port setting from PORT. The Quarkus default fast-jar in target/quarkus-app/ is not picked up: start it with a Procfile line such as web: java -Dquarkus.http.port=$PORT -jar target/quarkus-app/quarkus-run.jar, or build an uber-jar.

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_URL or CLICKHOUSE_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

Java on Nodion: questions and answers

Which Java versions can I use?

Temurin 11, 17, 21, 25, 26 and 27. Without a pin you get 21. Set java.runtime.version in system.properties; Maven and Gradle toolchain settings are not read.

Do my tests run during the deploy?

No. Gradle builds with -x test and Maven with -DskipTests, so deploys stay fast. Run your tests in CI before you merge.

Do Kotlin and Scala projects work?

Yes, as long as they build with Maven or Gradle and produce a runnable jar. sbt projects are not detected; use a Dockerfile for those.

Where does my Java 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 Java 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 Java on Nodion?

An app instance starts at 1 EUR per month. The setup in the cost box costs 5.50 EUR per month: App 4 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 Java 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.

Give your agent a cloud.

Earn up to 15 € in credit when signing up.

Continue with GitHub

or with email

Stay in the loop.

Product news, no spam. Unsubscribe anytime.