Where to host a Spring Boot app in 2026, and how long it takes to cold start
Spring Boot on Heroku, Render, Railway, Fly.io, Cloud Run, Lambda, Azure, Koyeb and Gregale, with a measured 4.3 s cold boot against an 87 ms snapshot restore.
You can host a Spring Boot app on Heroku, Railway or Koyeb straight from your Maven or Gradle project, or from a Docker image on Render, Fly.io, Google Cloud Run, Azure Container Apps or Gregale. AWS Lambda runs it through AWS’s Serverless Java Container wrapper. What happens after the app has been idle matters as much as where it runs, because Spring Boot takes seconds to start. In our test a minimal Spring Boot 4 API took 4.3 to 4.4 seconds to cold boot on Gregale, and 87 to 99 ms to restore from a snapshot. Lambda SnapStart and Fly.io’s suspend mode also resume from a snapshot. Azure Spring Apps retires on March 31, 2028.
Gregale publishes this page. The hosts’ facts come from their own pages, checked on December 4, 2026: Heroku Java support, Heroku Eco dyno hours, Heroku error codes, Render’s supported languages, Render’s free instances, Render pricing, Railpack’s Java support, Railway’s plans, Fly.io autostop, Fly.io pricing, Cloud Run’s Java tips, Cloud Run startup CPU boost, Lambda SnapStart, Lambda pricing, Serverless Java Container, Java on Azure Container Apps, the Azure Spring Apps retirement and Koyeb’s Java builds. Heroku’s dyno sizes, Render’s free RAM, Cloud Run’s free tier and Koyeb’s Free Instance come from our pages on Heroku, Render’s free tier, free backend tiers and free Flask hosting. Gregale’s come from its plans page, and its numbers from a test we ran on December 4.
Where Spring Boot runs
| Host | How Spring Boot gets there | Cheapest way to run it | While the app is idle |
|---|---|---|---|
| Gregale | From a Dockerfile; Gregale doesn’t build Java from source | Free: 1 app with 256 MB; Hobby: $10 a month for 5 apps with 512 MB each | Parks after 1 minute and wakes from a snapshot; first byte in 211 to 231 ms in our test |
| Heroku | The Java buildpack builds Maven or Gradle and detects Spring Boot | Eco: $5 a month for 1,000 dyno hours shared, 0.5 GB; Basic: $7, always on | Eco sleeps after 30 minutes idle, and the next request starts the dyno again |
| Render | From a Docker image; Render doesn’t run Java natively | Free: 512 MB and 750 hours a month; Starter: $7 a month for 512 MB, 0.5 CPU | Free spins down after 15 minutes without inbound traffic; about a minute to wake |
| Railway | Railpack builds Spring Boot with Gradle or Maven | Free: $5 of usage a month; Hobby: $5 a month | Free services sleep 5 to 10 minutes after their last outbound traffic |
| Fly.io | From a Dockerfile | $3.69 a month for a 512 MB shared-cpu-1x Machine running all month | Autostop: a stopped Machine takes about 2 seconds or more to start; a suspended one resumes in a few hundred ms |
| Google Cloud Run | From a container image | Free tier: 180,000 vCPU-seconds, 360,000 GiB-seconds and 2 million requests | Scales to zero; the next request starts a container, and startup CPU boost adds CPU while it starts, at a charge |
| AWS Lambda | Through AWS’s Serverless Java Container wrapper | Free tier: 1 million requests and 400,000 GB-seconds a month | SnapStart, for Java 11 and later at no extra cost, resumes from a snapshot of the initialized function |
| Azure Container Apps | From a container image, or a Java build from source | Consumption plan; we didn’t check its price for this page | Can scale to zero; Azure Spring Apps takes no new Basic or Standard customers and retires in 2028 |
| Koyeb | Its buildpack detects Java from pom.xml, with Maven by default | Free Instance: 512 MB and 0.1 vCPU, one per organization | Scales to zero after 1 hour without traffic; Koyeb’s default wake takes 1 to 5 seconds |
Why the cold start matters for Spring Boot
Before a Spring Boot app can answer, the JVM has to start and load classes,
and Spring has to scan and wire the application context. On December 4, 2026
we deployed our
Spring Boot Docker memory sample:
Spring Boot 4.2.0 on Java 21, two routes and Actuator, in a Docker image with
a jlink runtime, on a 512 MB instance. Spring logged that it started in
3.2 seconds. We measured:
- Cold boot, 3 runs: 4.3 to 4.4 seconds from a fresh boot to the first passing readiness check, starting the microVM, the JVM and Spring from scratch.
- Snapshot restore, 6 runs: 87 to 99 ms to restore the parked app, and 211 to 231 ms from the request reaching Gregale to the response’s first byte, by the app’s wake timeline.
- From a laptop in Istanbul: a parked app answered in 0.67 to 0.70 seconds end to end, against 0.48 to 0.52 seconds once it was running.
A host that scales to zero by stopping the app pays that startup on the next request. There are three ways around it:
- Resume from a snapshot. Gregale parks every app this way. Lambda
SnapStart snapshots the initialized function, and Fly.io’s
suspendmode resumes a suspended Machine in a few hundred milliseconds. - Keep an instance running. Heroku Basic, Render Starter and an always-on Fly.io Machine don’t sleep, and you pay for every hour.
- Start faster. Cloud Run’s startup CPU boost gives the container extra CPU while it starts, and its Java tips cover class data sharing (AppCDS), which reuses an archive of loaded classes.
Our cold start times by language page puts the same Spring Boot numbers next to Go, Node.js, Bun and FastAPI, which cold boot in about 1.1 seconds.
Which one fits your app
- You want
git pushwithout a Dockerfile. Heroku, Railway and Koyeb build a Maven or Gradle project for you. - The app is idle most of the day, and the first request has to be
fast. Pick a host that resumes from a snapshot: Gregale, Lambda with
SnapStart, or Fly.io with
suspend. On Render Free the first request after 15 idle minutes waits about a minute. - You’re on Azure Spring Apps. Microsoft recommends Azure Container Apps or AKS, and the service retires on March 31, 2028.
- The app runs scheduled jobs.
@Scheduledmethods only run while the app runs, so a host that sleeps stops them. Keep an instance running, or move the schedule to the platform’s cron.
Where Gregale fits
Gregale builds Spring Boot from a Dockerfile: Maven or Gradle builds the
jar, and jlink makes a small Java runtime. Our sample deployed in 75
seconds, including the Maven build.
The Free plan gives you 1 app with 256 MB and 20 GB-RAM-hours a month, and an app parks after 1 minute idle. Our Spring Boot Docker memory test ran a minimal Java 21 API at both 256 MB and 512 MB; an app with a database pool or more libraries will likely need Hobby’s 512 MB. Hobby, at $10 a month, adds 5 apps with 512 MB each, crons, WebSockets, a managed Postgres database and requests up to 1 minute.
To deploy your own, our Spring Boot guide covers the Dockerfile, PostgreSQL and Flyway migrations, and gregale-dev/spring-boot-postgres is a complete Spring Boot API with PostgreSQL.
What we verified
The hosts’ pages on December 4, 2026. We didn’t deploy Spring Boot to the other hosts for this page, so their cold starts aren’t measured here. Gregale’s plans are from its plans page that day, and the Spring Boot numbers from our own test, after which we deleted the test app.
Questions
- Where can I host a Spring Boot app?
Heroku, Railway and Koyeb build it from your Maven or Gradle project. Render, Fly.io, Google Cloud Run, Azure Container Apps and Gregale run it from a Docker image, and AWS Lambda runs it through AWS’s Serverless Java Container wrapper.
- How long does a Spring Boot cold start take?
In our test a minimal Spring Boot 4 API on Java 21 took 4.3 to 4.4 seconds from a fresh boot to its first passing readiness check, and Spring itself logged a 3.2-second start. Restoring the same app from a snapshot took 87 to 99 ms.
- How do I avoid Spring Boot cold starts?
Resume from a snapshot, as Gregale, Lambda SnapStart and Fly.io’s suspend mode do; keep an instance running, as Heroku Basic, Render Starter or an always-on Fly.io Machine does; or start faster with Cloud Run’s startup CPU boost and class data sharing.
- Can I host Spring Boot for free?
Render Free runs it from a Docker image with 512 MB, but it spins down after 15 idle minutes and takes about a minute to wake. Koyeb’s Free Instance has 512 MB and 0.1 vCPU, and Railway Free gives $5 of usage a month. Gregale Free’s 256 MB fits a minimal API; most apps need Hobby’s 512 MB at $10 a month.
- Is Azure Spring Apps being retired?
Yes. Every plan entered a three-year retirement period on March 17, 2025 and retires on March 31, 2028, and the Basic and Standard plans take no new customers. Microsoft recommends Azure Container Apps or AKS instead.