Deploy Spring Boot in minutes

Deploy your Spring Boot service on Darmi Cloud with the Dockerfile preset. The multi-stage Dockerfile below builds your JAR with Maven and runs it on a slim JRE behind automatic HTTPS.

Deploy from GitHub Automatic HTTPS subdomain Live build & runtime logs
Step by step

How to deploy Spring Boot

Darmi Cloud doesn't have a dedicated Spring Boot preset yet — but the Dockerfile preset gets you deployed just as fast.

  1. 1

    Add a Dockerfile to your repo

    Commit the Dockerfile below to the root of your Spring Boot repository. Darmi Cloud will build the image from it.

  2. 2

    Sign in with GitHub

    Open darmicloud.tech and sign in with GitHub (or Google). On first sign-in you grant read access so the deploy worker can clone your repositories.

  3. 3

    Import your repository

    Click New Project, pick your Spring Boot repository, and choose the branch to deploy — the default branch is preselected.

  4. 4

    Select the Dockerfile preset

    Choose the Dockerfile preset so Darmi Cloud builds and runs the image from your committed Dockerfile. Set the container port to 8080.

  5. 5

    Add environment variables

    Add any environment variables your app needs (database URLs, API keys, secrets). Mark sensitive values as secrets — they are injected into the container and hidden in the UI afterwards.

  6. 6

    Deploy and watch it go live

    Click Deploy. Watch the live build and runtime logs, and your app goes live on an automatic HTTPS subdomain. Every push to your branch redeploys automatically.

Dockerfile for Spring Boot

Copy this into a file named Dockerfile at the root of your repository.

# syntax=docker/dockerfile:1
FROM maven:3.9-eclipse-temurin-21 AS build
WORKDIR /app
COPY pom.xml .
RUN mvn -q dependency:go-offline
COPY src ./src
RUN mvn -q clean package -DskipTests

FROM eclipse-temurin:21-jre
WORKDIR /app
COPY --from=build /app/target/*.jar app.jar
ENV PORT=8080
EXPOSE 8080
CMD ["sh", "-c", "java -jar app.jar --server.port=$PORT"]

Tips for Spring Boot on Darmi Cloud

  • Set the container port in project settings to 8080 to match server.port and EXPOSE.
  • Use application-production.properties (or env vars) for your datasource — inject secrets from project settings.
  • If you use Gradle, swap the build stage for a gradle:jdk21 image and ./gradlew bootJar.
FAQ

Spring Boot deployment FAQ

Does Darmi Cloud build my Spring Boot JAR?

Yes, through the Dockerfile preset. The multi-stage Dockerfile above builds the JAR with Maven and runs it on a slim JRE image.

How do I configure the server port?

Read it from the PORT environment variable (--server.port=$PORT) and set the same value in the project's port setting so Traefik routes correctly.

Can I use my own custom domain?

Yes. Connect an existing domain or buy one inside Darmi Cloud. DNS is configured automatically and every domain gets free SSL via Let's Encrypt.

Can I self-host instead of using darmicloud.tech?

Yes. Darmi Cloud is fully self-hostable on any VPS with Docker, PostgreSQL, Redis and Traefik using a single docker-compose file — same features, your infrastructure.

Deploy other frameworks

Ready to deploy your Spring Boot app?

Connect GitHub and ship in minutes — on a free HTTPS subdomain, or on your own custom domain.

Deploy Spring Boot now