Skip to content

Quick Start — Java

Deploy a Java app (Spring Boot, Quarkus, Micronaut, plain JVM) from git push to a live HTTPS URL in 5 minutes.

Prerequisites

  • A Java project with pom.xml (Maven) or build.gradle (Gradle)
  • JDK 17+ on your machine (java --version)
  • The paas CLI:
    curl -fsSL https://get.di2amp.com/install.sh | sh
    paas --version
    

Scaffold (if you don't have a project yet — Spring Boot)

curl -s https://start.spring.io/starter.tgz \
  -d type=maven-project \
  -d language=java \
  -d bootVersion=3.2.5 \
  -d baseDir=hello-paas \
  -d name=hello-paas \
  -d packageName=com.example.hellopaas \
  -d dependencies=web \
  | tar -xzvf -
cd hello-paas
cat > src/main/java/com/example/hellopaas/HelloController.java <<'EOF'
package com.example.hellopaas;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @GetMapping("/")
    public String home() {
        return "Hello from PaaS Runtime!\n";
    }
}
EOF
git init && git add -A && git commit -m "init"

Step 1 — Authenticate

paas login

Verify:

$ paas whoami
octave@paas.local (member of: paas-default)

Step 2 — Create the app

paas apps create hello-paas

Output:

✓ Created app hello-paas
  URL:    https://hello-paas.runtime.di2amp.com
  Region: eu-fr-1
  Plan:   free
  Git:    https://git.di2amp.com/octave/hello-paas.git

Step 3 — Add a Procfile

Spring Boot reads SERVER_PORT (or PORT) automatically. The Paketo Java buildpack runs mvn clean package and produces a runnable jar:

# Procfile
web: java -jar target/*.jar --server.port=$PORT

Commit:

git add Procfile && git commit -m "add Procfile"

Step 4 — Push to deploy

git push paas main

Live build logs:

remote: ─────── PaaS Build ───────
remote: → Detected: java (paketo-buildpacks/java)
remote: → Installing Bellsoft Liberica JRE 17.0.10
remote: → Installing Maven 3.9.6
remote: → Running: mvn -B package -DskipTests
remote: → Image:    registry.di2amp.com/octave/hello-paas:abc1234
remote: → Image size: 234 MB (JRE base + jar)
remote: → SBOM:     ✓ generated, 92 packages
remote: → CVE scan: ✓ 0 critical, 0 high
remote:
remote: ─────── PaaS Deploy ───────
remote: → Process types: web
remote: → Replicas:      1/1 ready
remote: → Rollout:       v1 → v2 (canary 10% → 100%)
remote: → Health:        / returns 200 OK   (waited 28s for JVM warmup)
remote: → URL:           https://hello-paas.runtime.di2amp.com
remote:
remote: ✓ Deployed in 78s

JVM cold start adds 20–40s. The Paketo Memory Calculator auto-tunes -Xmx, -Xss, etc. based on container limits.

Step 5 — Verify the app is live

$ curl https://hello-paas.runtime.di2amp.com/
Hello from PaaS Runtime!

Dashboard runtime status:

https://ma30.di2amp.com/runtime/dashboard/apps/hello-paas

Next steps

Add a managed PostgreSQL

paas addons create database --type postgres --plan free --name db

DATABASE_URL is injected. Spring Boot config (application.properties):

spring.datasource.url=${DATABASE_URL}
spring.jpa.hibernate.ddl-auto=update

Tail logs

paas logs --tail

Tune JVM memory

The Paketo Java buildpack reads BPL_JVM_THREAD_COUNT and BPL_JVM_HEAD_ROOM:

paas config:set BPL_JVM_THREAD_COUNT=200
paas config:set BPL_JVM_HEAD_ROOM=10

Native image (GraalVM, faster cold start)

Switch to the GraalVM Paketo buildpack:

paas config:set BP_NATIVE_IMAGE=true

Build time goes up (5–10 min) but cold start drops to <100ms.

Scale processes

paas ps:scale web=3

See also