Spring Boot hosting in 2026: deploying a Java app built with Maven or Gradle
A Spring Boot app in production is one executable jar, a JVM sized to the container rather than the machine, the port from the environment and a build that fits the time limit. On Livops a repository with pom.xml or build.gradle is built into that jar and runs as a web app for 39 credits a month (39,000 so'm), with the heap set to 75% of the container's memory. Here is how Render, Railway, Fly.io, Heroku and a VPS compare.
By Livops team, the people who build and run LivopsUpdated
A Spring Boot app is one of the simplest things to deploy — a single jar and java -jar — and one of the easiest to deploy badly. The JVM sizes itself from the memory it can see, the default port is not the platform’s, and a Maven build with tests can outlast a build limit before the app ever starts. This page covers what Spring Boot and the JVM need in a container, compares Render, Railway, Fly.io, Heroku and a VPS with each provider’s own numbers, and ends with exactly what Livops builds and starts.
What does a Spring Boot app need in production?
A current JDK and build tool
Spring Boot 4.2.0, the current version, needs at least Java 17 and works up to Java 27; it supports Maven 3.6.3 or later and Gradle 8.14 or later, or 9.x[1]. Pick a JDK in that range for both the build and the run.
One executable jar
The Spring Boot build plugins make an executable jar holding every dependency, which runs with java -jar[5]. Gradle’s bootJar makes it; when it is configured, the plain jar task’s output gets the plain classifier, so build/libs holds two jars and only one of them runs[5]. A deploy has to pick the right one.
A JVM sized to the container
On Linux the JVM detects the container and reads its memory limit; this is on by default[6]. But its default maximum heap is only 25% of that limit (-XX:MaxRAMPercentage)[6]: in 512 MiB, about 128 MiB of heap and the rest unused. Raise the percentage (Livops uses 75%) and leave the remainder for what is not heap: metaspace, thread stacks, the code cache, direct buffers. Set it too high and the container runs out of memory before the heap does, and the process is killed rather than told.
The port from the environment
Spring Boot’s own default is 8080. A platform gives the port in an environment variable, and there are three ways to apply it: server.port=${PORT:8080} in application.properties, using the placeholder-with-default syntax[2]; the environment variable SERVER_PORT, by Spring’s rule of dots to underscores, dashes removed, upper case[2]; or -Dserver.port=$PORT on the command line. A Java system property outranks environment variables, which outrank application.properties[2], so the command line is the one that always wins.
Configuration from the environment
The same binding rule means any property can come from a variable: spring.datasource.url is SPRING_DATASOURCE_URL[2]. Database addresses and secrets belong there, not in the jar.
A health check and a clean shutdown
With Actuator, /actuator/health is exposed over HTTP by default, and so are the liveness and readiness groups at /actuator/health/liveness and /actuator/health/readiness[4]. On shutdown, Spring Boot’s embedded Tomcat, Jetty and Reactor Netty finish requests in flight and refuse new ones — graceful shutdown is on by default[3].
A build that fits the time
The first Maven or Gradle build downloads every dependency, and running the test suite inside the deploy doubles it. Keep the dependency cache between builds, and run the tests in CI.
The options at a glance
| Option | What it is | Smallest paid always-on web process | About 1 GB of memory | What you still maintain |
|---|---|---|---|---|
| Livops | A platform; servers in Uzbekistan | 39 credits (39,000 so’m) a month at the default size | The 1024 MiB tier; current prices in the cabinet | Your code |
| Render | A platform; Java runs from your Dockerfile | $7 a month: 0.5 CPU, 512 MB[9] | $25 a month: 1 CPU, 2 GB[9] | Your code and a Dockerfile |
| Railway | A platform billed by usage | Hobby: $5 a month, including that much usage[12] | About $10 a month per GB of RAM, plus about $20 per vCPU[12] | Your code |
| Fly.io | Virtual machines billed by the second | $3.69 a month for shared-cpu-1x with 512 MB[14] | $6.70 a month with 1 GB[14] | Your code and its Docker image |
| Heroku | A platform of dynos | Basic: $7 a month, 0.5 GB[7] | Standard-2X: $50 a month, 1 GB[7] | Your code |
| A VPS in Uzbekistan | A virtual machine with root | 82,000 so’m a month: 1 vCPU, 2 GB, 30 GB HDD (SmartCloud)[15] | The same machine | The JDK, a systemd unit, a reverse proxy, HTTPS, deploys |
Other providers’ prices are from each provider’s own page, read on 20 November 2026; the dates are in Sources below. Livops prices are the ones the cabinet bills today.
Each option
Livops
A pom.xml or build.gradle is enough: the jar is built on Livops’ servers with the dependency cache kept, started with the heap and port set (details below), and every git push ships a new version. A PostgreSQL or MySQL database arrives as SPRING_DATASOURCE_*. Payment is in so’m through Payme or Click, with no card, and the servers are in Uzbekistan — close to users there, farther from users elsewhere. You get no root, and one app’s memory stops at 2 GB.
Render
Java is not one of Render’s native runtimes: Render points JVM languages to Docker[10], so you write and maintain the Dockerfile, the JVM flags included. A web service is $7 a month for 0.5 CPU and 512 MB, and $25 for 1 CPU and 2 GB[9]. Render takes credit and debit cards[9].
Railway
Railway detects a Java app on its own[13], and bills memory at about $10 per GB and CPU at about $20 per vCPU a month, by the second, after the $5 Hobby plan’s included usage[12]. Its Spring Boot guide does not cover the port or JVM memory[13], so set both yourself. It is paid by credit card[12].
Fly.io
The cheapest memory here: $6.70 a month for a shared-cpu-1x machine with 1 GB, $3.69 with 512 MB, billed by the second[14]. You deploy a Docker image, so the JVM flags are in your Dockerfile. A card is needed once the trial ends[14].
Heroku
Where Heroku is better: it detects Spring Boot, Micronaut and Quarkus, and starts a Spring Boot app as java -Dserver.port=$PORT -jar target/<app>.jar when there is no Procfile[8]. The Java version is set in system.properties[8]. Memory is where it costs: Basic is $7 a month for 0.5 GB, and 1 GB means Standard-2X at $50[7].
A VPS
A 2 GB machine at SmartCloud is 82,000 so’m a month[15], and for a JVM, memory is what you are buying. Everything around the jar is yours: the JDK and its updates, a systemd unit with the right -Xmx, nginx and a certificate in front, and a deploy that builds the jar somewhere other than the 2 GB machine serving it.
VPS or platform: what do you maintain?
A jar and a systemd unit are a small amount of configuration, and a VPS gives a JVM the most memory per so’m. What it does not give you is the rest: a deploy that switches versions without dropping requests, a restart when the process dies, certificates that renew, and somebody watching the disk. On a platform those are done for you and you give up root and the choice of machine. If you run several JVM services and like servers, a VPS is cheaper per service. If you would rather spend the time on the code, use a platform.
Where can you host Spring Boot for free?
- Livops has no free tier for apps. On an account that has not paid yet, the first bot or app runs for 15 minutes on a zero balance, once, so you can watch it answer. One 500 MB database per team is free, and starts once the account has credits.
- Render gives free instances to web services; a free web service spins down after 15 minutes without inbound traffic and takes about a minute to start again, within 750 free instance hours a month per workspace[11]. A JVM’s own start-up adds to that minute. The free instance has 512 MB[9].
- Railway has a Free plan with $1 of usage a month and up to 0.5 GB per service, whose services sleep after 5 to 10 minutes without outbound traffic; a trial gives $5 of credit for 30 days, with no card[12].
- Fly.io has no free tier for new organizations; a trial gives $1 of credit for 7 days[14].
- Heroku lists no free dyno; Eco at $5 a month is the cheapest[7].
Spring Boot on Livops
- Push the repository. In the cabinet, click New project and choose it, or upload the folder as a
.zip. For a monorepo, set the folder the build is in. - Under Databases, add PostgreSQL or MySQL if you need one. Put other settings and secrets under Variables; a variable marked secret is never shown again.
- Deploy. The log shows the Maven or Gradle build and the start.
Livops makes it a Java project when pom.xml (Maven) or build.gradle, build.gradle.kts or settings.gradle (Gradle) is at the root and no Dockerfile builds it otherwise. What it does:
- Maven:
mvn -q -DskipTests package, with the project’s ownmvnwwhen its wrapper is complete. The fat jar is copied out asapp.jar— a module’s, under an aggregator pom — skipping*-plain.jarand*.original. - Gradle:
bootJar -x test --no-daemon, withgradlewwhen the wrapper jar is committed. When the root does not apply the Spring Boot plugin and exactly one module does, that module’sbootJaris built. The-plain.jaris never picked. - The JDK: 21, or 11 for a project that targets Java 11 or older, 17 for one targeting 12 to 17, 25 for one newer than 21; read from
java.version,maven.compiler.sourceorreleaseinpom.xml, orsourceCompatibilityin Gradle. - Plugins a deploy has no use for are skipped: Docker image plugins (Jib, Spotify’s and fabric8’s), git-commit-id, Spotless, PMD and Checkstyle. A build cannot reach Docker.
- The cache: Maven’s repository and Gradle’s home are kept from one build to the next.
- The start:
java -XX:MaxRAMPercentage=75 --add-opens java.base/java.lang=ALL-UNNAMED -Dserver.port=$PORT $JAVA_OPTS -jar app.jar
- The port:
-Dserver.portoutranks yourapplication.propertiesandSERVER_PORT, so you do not need to set either.--add-openslets the cglib of Spring Boot 1.x and Spring 4 run on a modern JDK; a current app does not notice it. JAVA_OPTScomes last and wins:-XX:MaxRAMPercentage=65for more room outside the heap, or-Dspring.profiles.active=prod.- Databases: for a Maven or Gradle project, PostgreSQL and MySQL write
SPRING_DATASOURCE_URL(thejdbc:form),SPRING_DATASOURCE_USERNAMEandSPRING_DATASOURCE_PASSWORD; Redis writesSPRING_DATA_REDIS_HOST,_PORTand_PASSWORD(and Spring Boot 2’sSPRING_REDIS_*); MongoDB writesSPRING_DATA_MONGODB_URI. If the jar has no JDBC driver for the database inSPRING_DATASOURCE_URL, those three are left out when it starts, so an app on H2 is not broken by a database it does not use. - On a new push, the new jar has a minute to answer on
PORT— onhealthPathwith 2xx or 3xx, if you set one — before traffic moves to it. The old one keeps running 15 seconds for requests in flight, then gets SIGTERM and 30 seconds, which Spring’s graceful shutdown uses. If the new one never answers, the old one keeps serving. - Builds may run for ten minutes. If the first one runs out of time downloading dependencies, deploy again: what was fetched stays in the cache, and the build continues from there.
Memory is the setting that matters most. Without memory, a web app gets 384 MiB, which leaves a Spring Boot app about 288 MiB of heap; the tiers are:
memory |
Heap at 75% | CPU |
|---|---|---|
| 256 | about 192 MiB | 1 |
| 512 | about 384 MiB | 1 |
| 1024 | about 768 MiB | 1 |
| 2048 | about 1536 MiB | 2 |
If the log says Killed or exit code 137, the process went past the tier: choose a bigger one in the settings, or lower MaxRAMPercentage in JAVA_OPTS if it is the memory outside the heap that grew. The tier is set with memory in livops.json when the project is created, and in the settings afterwards; the type and the tier are what you pay for. With Actuator on the classpath, give the health check its path:
{
"kind": "web",
"healthPath": "/actuator/health",
"memory": 1024
}
Two build failures have a ready answer in the log. A Gradle wrapper older than version 5 cannot run on these JDKs: update it with gradle wrapper --gradle-version 8.14 and commit the gradle/ folder; see Build failed. And a Dockerfile that starts FROM openjdk: names images that were removed from Docker Hub: use eclipse-temurin with the same version. With a Dockerfile in the repository, it builds the project instead; see Docker hosting.
A Spring Boot app is 39 credits a month (39,000 so’m) at the default size. One credit is 1,000 so’m, and bought credits never expire. See Pricing for plans, which give more credits than they cost, and Frameworks for everything livops.json accepts.
Questions
Do I need server.port=${PORT} in application.properties?
No. Livops starts the jar with -Dserver.port set to the PORT variable. A Java system property outranks both environment variables and application.properties in Spring Boot, so the port is right even when the app sets its own, and even for a Kotlin main that passes no arguments.
How much heap does my app get?
75% of the service's memory, through -XX:MaxRAMPercentage=75: about 384 MiB of heap on the 512 MiB tier, 768 MiB on 1024 and 1536 MiB on 2048. The rest is for the JVM's own memory: metaspace, thread stacks and the code cache. Set JAVA_OPTS under Variables to change it; it comes last on the command line and wins.
Which Java version does it build and run with?
JDK 21 by default. A project whose pom.xml or build.gradle targets Java 11 or older is built with JDK 11, one targeting 12 to 17 with JDK 17, and one newer than 21 with JDK 25, which then also runs the jar.
Are my tests run during the build?
No. Maven runs package with -DskipTests and Gradle runs bootJar with -x test, so the build stays inside the ten-minute limit. Run your tests in CI before the push.
How do I connect a database?
Add PostgreSQL or MySQL under Databases. For a Maven or Gradle project, SPRING_DATASOURCE_URL in its JDBC form, SPRING_DATASOURCE_USERNAME and SPRING_DATASOURCE_PASSWORD are written into the service, which Spring Boot reads with no code change. Redis arrives as SPRING_DATA_REDIS_HOST, PORT and PASSWORD.
How much does a Spring Boot app cost on Livops?
39 credits a month, which is 39,000 so'm at 1,000 so'm a credit, at the default size; a bigger memory tier costs more, and current prices are in the cabinet. There is no free tier for apps; on an account that has not paid yet, the first app runs for 15 minutes on a zero balance, once. Credits are bought in so'm through Payme or Click, with no card.
Who wrote this comparison?
The Livops team. Every price and limit of another provider on this page links to that provider's own page, with the day we read it.
Sources
- Spring Boot — System Requirements (docs.spring.io). Checked .
- Spring Boot — Externalized Configuration (docs.spring.io). Checked .
- Spring Boot — Graceful Shutdown (docs.spring.io). Checked .
- Spring Boot — Actuator Endpoints (docs.spring.io). Checked .
- Spring Boot Gradle Plugin — Packaging Executable Archives (docs.spring.io). Checked .
- Oracle — The java Command (JDK 21) (docs.oracle.com). Checked .
- Heroku — Pricing (heroku.com). Checked .
- Heroku — Java Support (devcenter.heroku.com). Checked .
- Render — Pricing (render.com). Checked .
- Render — Native runtimes (render.com). Checked .
- Render — Deploy for free (render.com). Checked .
- Railway — Pricing (railway.com). Checked .
- Railway — Deploy a Spring Boot app (railway.com). Checked .
- Fly.io — Pricing (docs.fly.io). Checked .
- SmartCloud — VDS plans (smartcloud.uz). Checked .
Put your project online today
Connect GitHub or drop a folder. No card is asked for.
Deploy your Spring Boot appRelated
- Docker hosting: how to deploy a Docker container or a DockerfileTo host a container you need a host that builds or pulls the image, starts its CMD, sends traffic to the port it listens on and stops it with SIGTERM. On Livops a Dockerfile at the root of the repository is built on Livops's servers and runs for 39 credits a month (39,000 so'm); a public image from Docker Hub, GHCR or Quay runs without a build. Here is what a container needs, and how a VPS, Render, Railway, Fly.io, DigitalOcean and Heroku compare.
- App not listening on $PORT: why the health check failed after deployThe platform started your app, tried the port it gave it, and nothing answered in time. Almost always the app listens on its own fixed port instead of the PORT variable, listens on localhost (127.0.0.1) instead of 0.0.0.0, or crashed or was still starting when the check gave up. Listen on 0.0.0.0 and the port in PORT, and it passes.
- Error: listen EADDRINUSE: address already in use — how to fix itYour server tried to listen on a port that another process on the same machine already holds. On your computer, stop the old process, usually a dev server still running in another terminal. In a deploy, it almost always means the app starts its server twice, or two processes in one container ask for the same port.
- Go hosting in 2026: how to deploy a Go appA Go web app compiles to one binary, so hosting it means building that binary, running it on the port it is given and shutting it down with http.Server.Shutdown. On Livops you push a repository with go.mod: it is built with CGO off into a static binary and runs as a web app for 39 credits a month (39,000 so'm). Here is what Go needs, and how a VPS, Render, Railway, Fly.io and DigitalOcean compare.
- The best Heroku alternative in 2026: six options comparedHeroku moved to a sustaining engineering model in February 2026 and no longer sells Enterprise contracts to new customers, but card-paying customers keep the same service and prices. If you are moving anyway: Render is the closest like-for-like, Railway bills by usage, Fly.io is the cheapest in dollars, DigitalOcean is the simplest flat price, Coolify runs on your own servers, and Livops fits apps whose users are in Uzbekistan, at 39 credits a month (39,000 so'm) for an app.
- Livops vs Railway: which one to deploy on in 2026Pick Railway if your users are in the US, Europe or Southeast Asia, you pay by card, and you want usage-based billing with high-availability databases. Pick Livops if your users are in Uzbekistan and you want to pay through Payme or Click, with no card, at a fixed 19 credits a month for a bot or 39 for an app.