A Java app that runs on your laptop and fails on a host is almost never a mystery. The JAR is the same file. What changes is the world around it: the port the platform listens on, the memory the container is allowed, the database it has to reach, the time it gets to start, and the disk it writes to. This clinic is organised by what you see, so you can start from the symptom and skip the guesswork.
Figures and platform behaviour checked in November 2026 against each provider's documentation.
Pick your symptom
| What you see | Most likely cause | Go to |
|---|---|---|
| Builds fine, but the URL shows an error or a timeout | Wrong port or host binding, missing environment variable, Java version mismatch | Works locally, not online |
| The app stops or restarts, log ends without a stack trace | Container memory limit, exit code 137 | Exit code 137 and restart loops |
Connection refused, timeout or SSL errors at startup |
Wrong JDBC URL, missing sslmode, network not allowed |
Cannot connect to the database |
| The first request after a break takes many seconds | Free tier sleep, slow JVM startup | Slow first request |
| Uploads or generated files are gone after a deploy | Ephemeral filesystem | Files disappear |
If two symptoms appear together, start with memory. An app that is killed for using too much memory also looks slow, restarts, and loses whatever it kept in local files.
Read the right log first
Every platform keeps two logs that matter here: the build or deploy log, which shows how the image or JAR was made, and the runtime log, which shows what the app printed after it started. Read the runtime log from the top of the last start. The first exception is the cause; everything after it is usually a consequence.
Three lines are worth searching for straight away:
UnsupportedClassVersionErrormeans the JAR was compiled for a newer Java than the runtime on the host.Address already in useor no line at all about the web server starting means the port is wrong.- A log that stops in the middle of normal output, followed by a restart, points to the process being killed from outside.
Check the environment, not the code
Most of the differences between your machine and the host are configuration. Compare four things before you change a line of code: the Java version (java -version locally, the base image or runtime setting on the host), the environment variables the app reads, the memory limit of the plan, and the port. If those match, the remaining causes are network rules and file storage, which have their own pages above.
The deployment guide shows a working setup step by step, and the Java Launchpad helps pick a plan that fits the app before you deploy it again.
A five-minute check before every deploy
Most of the problems in this clinic can be caught before the first deploy. Run through this list once per app and again whenever the plan or the platform changes:
- Port: the app reads the platform's port, for example
server.port=${PORT:8080}, and listens on all addresses, not onlylocalhost. - Java version: the build target, the base image and the platform runtime use the same major version.
- Variables: every value the app reads at startup is set on the host, and the app fails with a clear message when one is missing.
- Memory: the heap is sized as a share of the container with
-XX:MaxRAMPercentage, not with a fixed-Xmxcopied from a laptop. - Database: the URL is in JDBC format, includes
sslmode=requirewhere the provider requires SSL, and the pool fits the plan's connection limit. - Files: nothing the app needs to keep is written to the local disk.
- Health check: it points at a light endpoint and allows for the startup time you measured on the host.
Each point links to a symptom page above if it fails. Working through the list takes a few minutes; a failed deploy on a free tier can cost an evening.
When it is the plan, not the app
Some failures are limits of the plan you chose. A free tier that sleeps will always have a slow first request, and a 512 MB instance cannot hold a heap meant for 2 GB. The hosting comparison lists memory, sleep rules and price for each plan, so you can see whether a fix is a setting or an upgrade.
Sources