What you need before starting
- A Linux server with SSH and a JDK or JRE matching the version you compile with.
- A database reachable from the server and a domain.
The steps, in short
- Package the project:
./mvnw clean package(or./gradlew bootJar). You get an executable JAR intarget/orbuild/libs/. - Separate the configuration: use a
prodprofile and environment variables for credentials; do not leave them inapplication.propertiesinside the JAR. - Upload the JAR to the server and test it with
java -jar app.jar. - Create a systemd service with automatic restart and an
-Xmxthat fits the server. - Put Nginx in front as a proxy to the app’s port (8080 by default) and enable HTTPS with Let’s Encrypt.
- Check the health endpoints (Spring Boot Actuator) to monitor that the app is alive.
Common mistakes
- Compiling with a newer Java version than the one installed on the server.
- Leaving the app port open to the public instead of only Nginx.
- Leaving the H2 console or Actuator endpoints exposed without protection.
- Running with the development configuration (
ddl-auto=update, debug logs) in production.
How we help
In the free session we review your project and define the server, memory and database. Then we publish it with HTTPS, automatic deploys and monitoring.