# Deploy Spring Boot built with Gradle to your own VPS Deploy a Spring Boot app built with Gradle to your own VPS: ox runs gradlew bootJar, reads the Java version from build.gradle.kts, and runs the jar. To deploy Spring Boot with Gradle to a VPS with ox, add the repo as a project and deploy it, with no Dockerfile and no ox.toml. ox reads `build.gradle.kts` and `gradlew`, runs `./gradlew --no-daemon bootJar`, then starts `java -jar build/libs/demo-0.0.1-SNAPSHOT.jar` under systemd behind Caddy with HTTPS. Run `ox check` in your repo to see the same plan before the first deploy. **Plan verified, real-server test pending.** The plan below is what `ox check` prints for a minimal Spring Boot (Gradle) repo in ox's tests. A deploy on a real server is not recorded yet. ox reads `build.gradle.kts` and `gradlew`, builds the plan on the card, and starts `java -jar build/libs/demo-0.0.1-SNAPSHOT.jar` on your server. ## What ox detects in a Spring Boot (Gradle) repo This is the plan `ox check` prints for a minimal a Spring Boot app built with Gradle, with no ox.toml. Each row says where its value came from: a file in the repo, or ox's default. | Field | Value | Source | | --- | --- | --- | | `app.start` | `SERVER_ADDRESS=127.0.0.1 SERVER_PORT=$PORT java -jar build/libs/demo-0.0.1-SNAPSHOT.jar` | `detected:build.gradle.kts` | | `build.commands[0]` | `./gradlew --no-daemon bootJar` | `detected:gradlew` | | `tools.java` | `temurin-17` | `detected:build.gradle.kts` | `ox check` also prints these hints for it: - `the JVM sizes its heap to a quarter of the server's memory: set [app] memory (or [limits] memory) in ox.toml, and ox passes -Xmx at three quarters of it` ## The ox.toml for Spring Boot (Gradle) None is needed: the plan above comes from the repo alone. Write one to serve your own domain or to change what ox detected, and to size the JVM's heap, as the hint says: ox passes -Xmx at three quarters of [app] memory. This one passes `ox check` against the same repo: `[app]` keeps the detected start command and build. ox.toml, optional: ```toml domains = ["www.example.com"] [app] memory = "1G" ``` ## Check and deploy Spring Boot (Gradle) Add the repo as a project, then check and ship it from a terminal: Check, deploy and read the logs: ```sh ox check # in the repo: the plan above, offline ox new --server # add the repo as a project ox deploy --wait # stream the deploy, exit with its result ox logs --follow # the app's own logs ``` ## Variables to set for Spring Boot (Gradle) None before the first deploy: `ox check` asks for no variable. Add your own on the dashboard's Variables tab or with `ox vars set KEY`. ox provides these to the app itself: `PORT`, `HOST`, `OX_ENV`, `OX_PROJECT`, `OX_RELEASE`, `OX_DATA_DIR`, `PUBLIC_URL` and `PUBLIC_HOST`. ## If the Spring Boot (Gradle) deploy fails - `killed by the out-of-memory killer (the build needs more memory than the project or host allows)`: The build ran out of memory. Raise the project's memory, add swap, or use a bigger server. [More](https://deploywithox.com/docs/troubleshooting#out-of-memory). - `TCP connect to 127.0.0.1:8001 did not answer within 120s: dial tcp 127.0.0.1:8001: connect: connection refused`: The app started but never answered on the port ox gave it. Listen on `127.0.0.1` at `$PORT`; the lines above the message are the app's own output. [More](https://deploywithox.com/docs/troubleshooting#health-check-failed). - `Java project found (pom.xml) without Spring Boot or Quarkus: ox does not know how to build and start it; add an ox.toml with [build] commands and [app] start`: ox plans Spring Boot and Quarkus. For another Java app, write `[build] commands` and `[app] start`. [More](https://deploywithox.com/docs/config#build). Your visitors never see a failed deploy: the previous release keeps serving until the new one passes its health check. ## Next steps - [Spring Boot (Maven)](https://deploywithox.com/docs/guides/spring-boot): Deploy a Spring Boot app built with Maven to your own VPS. - [The `[app]` keys](https://deploywithox.com/docs/config#app): start, health check, memory and the rest. - [Add a custom domain](https://deploywithox.com/docs/operate/domains) with one A record; Caddy gets the HTTPS certificate. - [Read the logs](https://deploywithox.com/docs/operate/logs) live, search them, or download them. - [Set variables and secrets](https://deploywithox.com/docs/operate/variables) on the dashboard or with `ox vars`. ## Spring Boot (Gradle) FAQ ### Do I need a Dockerfile or an ox.toml to deploy Spring Boot with Gradle to a VPS? No. ox does not use Docker, and `ox check` on a Spring Boot (Gradle) repo with no ox.toml prints `Ready to deploy.` Write an ox.toml only to change what ox detected. ### What does ox install on the server for Spring Boot (Gradle)? Only what the plan names: `java temurin-17` (read from `build.gradle.kts`). Your app's own dependencies are installed by the build into the release folder, not system-wide. ### Which Java version does ox install? The one your build asks for. Here `build.gradle.kts` sets a toolchain of 17, so ox installs Temurin 17, as the plan above shows. ## Related guides - [**Quarkus**Deploy a Quarkus app to your own VPS in JVM mode: ox builds it with mvnw, runs quarkus-run.jar under systemd, checks /q/health and adds PostgreSQL for it.](https://deploywithox.com/docs/guides/quarkus) - [**ASP.NET Core**Deploy an ASP.NET Core app to your own Linux VPS: ox installs the .NET 10 SDK, runs dotnet publish, starts the DLL under systemd, and adds PostgreSQL.](https://deploywithox.com/docs/guides/aspnet-core) Every stack ox deploys, and the ones it does not yet, is on the [Stacks page](https://deploywithox.com/docs/guides). Last updated 2026-10-09. The page as HTML: https://deploywithox.com/docs/guides/spring-boot-gradle