{
  "manifest_version": "1",
  "slug": "spring-boot",
  "title": "Spring Boot",
  "headline": "Deploy a Spring Boot app",
  "description": "Deploy a Spring Boot app to an exe.dev VM: git push builds the jar on Java 25, systemd runs it, PostgreSQL and Flyway keep your data, HTTPS included.",
  "category": "frameworks",
  "tags": [
    "spring boot",
    "java",
    "java 25",
    "spring security",
    "spring data jpa",
    "flyway",
    "postgresql",
    "spring ai",
    "maven",
    "gradle",
    "git push deploy",
    "heroku alternative"
  ],
  "url": "https://exe.dev/deploy/spring-boot",
  "markdown_url": "https://exe-staging.dev/deploy/spring-boot.md",
  "upstream": {
    "website": "https://spring.io/projects/spring-boot",
    "source": "https://github.com/spring-projects/spring-boot",
    "docs": "https://docs.spring.io/spring-boot/",
    "license": "Apache-2.0"
  },
  "example_vm_name": "my-spring-boot",
  "time": "15 minutes",
  "stack": [
    {
      "name": "Your Spring Boot app",
      "detail": "one executable jar, built by Maven or Gradle from your repository, as app.service under systemd",
      "port": 8000,
      "data": "~/app → the current release in ~/releases"
    },
    {
      "name": "Java 25",
      "detail": "OpenJDK 25, the current LTS, from Ubuntu's packages"
    },
    {
      "name": "PostgreSQL 18",
      "detail": "the app's database, migrated by Flyway when the app starts; settings in ~/app.env",
      "data": "/var/lib/postgresql/18/main"
    },
    {
      "name": "git push deploys",
      "detail": "A pre-receive hook in ~/app.git builds, backs up, switches, and waits for readiness"
    },
    {
      "name": "Actuator",
      "detail": "health and readiness on 127.0.0.1:8081, apart from the app's port",
      "port": 8081
    },
    {
      "name": "Nightly backup",
      "detail": "app-backup.timer; a database dump, settings, and the repository",
      "data": "~/backups"
    }
  ],
  "access": [
    {
      "url": "https://my-spring-boot.exe.xyz/",
      "who": "private",
      "what": "Your app, until you make it public"
    },
    {
      "url": "https://my-spring-boot.exe.xyz:8081/actuator/health",
      "who": "private",
      "what": "Actuator's health check, for you, even once the app is public"
    },
    {
      "url": "my-spring-boot.exe.xyz:app.git",
      "who": "private",
      "what": "`git push exe main` deploys"
    }
  ],
  "inputs": [
    {
      "name": "REPO",
      "description": "the GitHub repository to deploy, as owner/name or a URL, or `new` to start a fresh Spring Boot app"
    }
  ],
  "delivers": [
    "Your app from GitHub (REPO), or a new Spring Boot 4 guestbook, running on Java 25 as app.service on port 8000, enabled to come back after a reboot.",
    "PostgreSQL 18 on the VM with a database and a generated password for the app, passed in through ~/app.env (mode 600), with the JVM's memory flags.",
    "A ~/app.git repository whose pre-receive hook builds each push to main with the project's Maven or Gradle wrapper, backs up the database, and rejects the push if the new version doesn't report ready.",
    "Actuator's health and readiness on 127.0.0.1:8081, off the app's port, and the proxy's X-Forwarded headers trusted, so redirects and cookies use HTTPS.",
    "For a new app, a guestbook that signs people in through exe.dev's X-ExeDev-Email header with Spring Security, and an /admin page for the emails in APP_ADMINS.",
    "A nightly backup timer, and a first backup whose database dump is restored into a scratch database and counted."
  ],
  "owner_runs_after": [
    "git clone -o exe my-spring-boot.exe.xyz:app.git    # if you started fresh",
    "git remote add exe my-spring-boot.exe.xyz:app.git  # if you brought your app: in your checkout"
  ],
  "deployable": true,
  "deploy": {
    "new_vm_url": "https://exe-staging.dev/new?prompt=REPO%3D%3Cfill-this-in%3E%0A%0ASet%20up%20Spring%20Boot%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fexe-staging.dev%2Fdeploy%2Fspring-boot.md%20from%20top%20to%20bottom.%0A%0AThe%20values%20at%20the%20top%20of%20this%20message%20are%20mine%3A%0A-%20REPO%3A%20the%20GitHub%20repository%20to%20deploy%2C%20as%20owner%2Fname%20or%20a%20URL%2C%20or%20%60new%60%20to%20start%20a%20fresh%20Spring%20Boot%20app%0AAsk%20me%20for%20any%20that%20still%20say%20%3Cfill-this-in%3E%20before%20you%20need%20them.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-spring-boot.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-spring-boot.%20Skip%20the%20step%20that%20creates%20the%20VM%3B%20you%20are%20on%20it.%0A%0AYou%20are%20done%20when%20all%20of%20these%20are%20true.%20Check%20each%20one%20yourself%3A%0A-%20Your%20app%20from%20GitHub%20%28REPO%29%2C%20or%20a%20new%20Spring%20Boot%204%20guestbook%2C%20running%20on%20Java%2025%20as%20app.service%20on%20port%208000%2C%20enabled%20to%20come%20back%20after%20a%20reboot.%0A-%20PostgreSQL%2018%20on%20the%20VM%20with%20a%20database%20and%20a%20generated%20password%20for%20the%20app%2C%20passed%20in%20through%20~%2Fapp.env%20%28mode%20600%29%2C%20with%20the%20JVM%27s%20memory%20flags.%0A-%20A%20~%2Fapp.git%20repository%20whose%20pre-receive%20hook%20builds%20each%20push%20to%20main%20with%20the%20project%27s%20Maven%20or%20Gradle%20wrapper%2C%20backs%20up%20the%20database%2C%20and%20rejects%20the%20push%20if%20the%20new%20version%20doesn%27t%20report%20ready.%0A-%20Actuator%27s%20health%20and%20readiness%20on%20127.0.0.1%3A8081%2C%20off%20the%20app%27s%20port%2C%20and%20the%20proxy%27s%20X-Forwarded%20headers%20trusted%2C%20so%20redirects%20and%20cookies%20use%20HTTPS.%0A-%20For%20a%20new%20app%2C%20a%20guestbook%20that%20signs%20people%20in%20through%20exe.dev%27s%20X-ExeDev-Email%20header%20with%20Spring%20Security%2C%20and%20an%20%2Fadmin%20page%20for%20the%20emails%20in%20APP_ADMINS.%0A-%20A%20nightly%20backup%20timer%2C%20and%20a%20first%20backup%20whose%20database%20dump%20is%20restored%20into%20a%20scratch%20database%20and%20counted.%0A%0ARead%20the%20whole%20recipe%2C%20including%20the%20closed%20details.%20Follow%20%22Set%20up%20by%0Ahand%22%20from%20%22Install%20Java%22%20to%20the%20end%20of%20it%2C%20as%20exedev%3B%20the%20walkthrough%0Aabove%20it%20is%20for%20the%20owner%20afterwards.%20Do%20not%20run%20Restore%20or%20Update%2C%20and%0Ado%20not%20reboot.%20Leave%20public%20sharing%20off.%0AREPO%20picks%20one%20path%20in%20%22Get%20the%20code%22%3A%20%60new%60%20starts%20a%20fresh%20app%3B%0Aanything%20else%20is%20a%20GitHub%20repository%20%28turn%20URLs%20into%20owner%2Fname%29.%20Never%0Acommit%20to%20a%20repository%20you%20cloned%3A%20its%20settings%20go%20in%20~%2Fapp.env.%20If%20a%0Aclone%20fails%2C%20follow%20the%20private-repository%20steps%2C%20and%20if%20that%20fails%0Atoo%2C%20give%20the%20owner%20the%20integration%20command%20and%20wait%20for%20them.%0AFor%20a%20cloned%20app%2C%20follow%20%22Bring%20your%20app%22%3A%20fill%20~%2Fapp.env%20from%20its%0Aapplication.properties%20or%20application.yml%20and%20README%2C%20generate%20secrets%0Awith%20openssl%2C%20ask%20the%20owner%20for%20keys%20to%20outside%20services%2C%20and%20never%0Ainvent%20values.%20If%20a%20build%20fails%2C%20read%20its%20output%2C%20fix%20what%20you%20can%0Awithout%20editing%20the%20code%2C%20and%20redeploy%20with%0A~%2Fapp.git%2Fhooks%2Fpre-receive%20HEAD.%0AKeep%20the%20deploy%20hook%20and%20backup%20script%20as%20written%2C%20since%20the%20page%0Adocuments%20how%20they%20behave%3B%20if%20one%20looks%20wrong%2C%20say%20so%20at%20the%20end.%0AFinish%20with%20the%20app%27s%20URL%3B%20only%20the%20one%20git%20command%20from%20%60after%60%20that%0Afits%3B%20and%20what%20you%20set%20in%20~%2Fapp.env%20for%20their%20app.%0A%0AFinish%20with%20the%20URLs%20I%20should%20open%20and%20these%20commands%2C%20which%20only%20I%20can%20run%2C%20from%20my%20own%20computer%20%28with%20this%20VM%27s%20name%20in%20them%29%3A%0A%20%20git%20clone%20-o%20exe%20my-spring-boot.exe.xyz%3Aapp.git%20%20%20%20%23%20if%20you%20started%20fresh%0A%20%20git%20remote%20add%20exe%20my-spring-boot.exe.xyz%3Aapp.git%20%20%23%20if%20you%20brought%20your%20app%3A%20in%20your%20checkout%0A",
    "terminal": "curl -fsSL https://exe-staging.dev/deploy/spring-boot/prompt.txt | ssh exe.dev new --prompt=/dev/stdin",
    "prompt": "REPO=\u003cfill-this-in\u003e\n\nSet up Spring Boot on this VM by following the exe.dev recipe at https://exe-staging.dev/deploy/spring-boot.md from top to bottom.\n\nThe values at the top of this message are mine:\n- REPO: the GitHub repository to deploy, as owner/name or a URL, or `new` to start a fresh Spring Boot app\nAsk me for any that still say \u003cfill-this-in\u003e before you need them.\n\nThe recipe's example VM name is my-spring-boot. This VM's name is the output of `hostname`: use it wherever the recipe writes my-spring-boot. Skip the step that creates the VM; you are on it.\n\nYou are done when all of these are true. Check each one yourself:\n- Your app from GitHub (REPO), or a new Spring Boot 4 guestbook, running on Java 25 as app.service on port 8000, enabled to come back after a reboot.\n- PostgreSQL 18 on the VM with a database and a generated password for the app, passed in through ~/app.env (mode 600), with the JVM's memory flags.\n- A ~/app.git repository whose pre-receive hook builds each push to main with the project's Maven or Gradle wrapper, backs up the database, and rejects the push if the new version doesn't report ready.\n- Actuator's health and readiness on 127.0.0.1:8081, off the app's port, and the proxy's X-Forwarded headers trusted, so redirects and cookies use HTTPS.\n- For a new app, a guestbook that signs people in through exe.dev's X-ExeDev-Email header with Spring Security, and an /admin page for the emails in APP_ADMINS.\n- A nightly backup timer, and a first backup whose database dump is restored into a scratch database and counted.\n\nRead the whole recipe, including the closed details. Follow \"Set up by\nhand\" from \"Install Java\" to the end of it, as exedev; the walkthrough\nabove it is for the owner afterwards. Do not run Restore or Update, and\ndo not reboot. Leave public sharing off.\nREPO picks one path in \"Get the code\": `new` starts a fresh app;\nanything else is a GitHub repository (turn URLs into owner/name). Never\ncommit to a repository you cloned: its settings go in ~/app.env. If a\nclone fails, follow the private-repository steps, and if that fails\ntoo, give the owner the integration command and wait for them.\nFor a cloned app, follow \"Bring your app\": fill ~/app.env from its\napplication.properties or application.yml and README, generate secrets\nwith openssl, ask the owner for keys to outside services, and never\ninvent values. If a build fails, read its output, fix what you can\nwithout editing the code, and redeploy with\n~/app.git/hooks/pre-receive HEAD.\nKeep the deploy hook and backup script as written, since the page\ndocuments how they behave; if one looks wrong, say so at the end.\nFinish with the app's URL; only the one git command from `after` that\nfits; and what you set in ~/app.env for their app.\n\nFinish with the URLs I should open and these commands, which only I can run, from my own computer (with this VM's name in them):\n  git clone -o exe my-spring-boot.exe.xyz:app.git    # if you started fresh\n  git remote add exe my-spring-boot.exe.xyz:app.git  # if you brought your app: in your checkout\n",
    "prompt_url": "https://exe-staging.dev/deploy/spring-boot/prompt.txt"
  },
  "updated": "2026-11-16",
  "verified": "2026-11-16",
  "related": [
    "postgres",
    "go",
    "django",
    "fastapi",
    "nodejs",
    "rails"
  ],
  "alternatives": [
    "Heroku",
    "Railway",
    "Render",
    "Northflank"
  ],
  "files": [
    "https://exe-staging.dev/deploy/spring-boot/starter.sh"
  ]
}
