[{"data":1,"prerenderedAt":117},["ShallowReactive",2],{"seo-verification":3,"blog-deployer-spring-boot-vps-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"id":7,"slug":8,"title":9,"excerpt":10,"readTime":11,"views":12,"isPinned":13,"publishedAt":14,"category":15,"categories":21,"featuredImage":23,"bgImage":24,"posterImage":25,"relatedSolution":26,"intro":28,"sections":29,"ctaTitle":72,"ctaBody":73,"ctaButton":74,"ctaUrl":75,"relatedPosts":76},50,"deployer-spring-boot-vps","Deploying a Spring Boot application on a VPS","Deploy a Spring Boot application on a Cloud VPS with Docker, an executable JAR, Nginx and SSL. A complete guide for Java developers.",8,250,false,"2026-05-01T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},4,"Development","developpement","bg-warning\u002F10 text-warning","dev",[22],{"id":16,"name":17,"slug":18,"color":19,"icon":20},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fdeployer-spring-boot-vps-poster.svg",{"categorySlug":18,"appSlug":27},"spring-boot","Spring Boot remains the standard for enterprise Java APIs and microservices. Rather than paying for a PaaS billed by JVM memory, a VPS gives you full control over the heap, the connection pool and the monthly cost. Here is how to deploy your artifact cleanly in production.",[30,34,44,47,69],{"type":31,"title":32,"body":33},"h2","Why self-host Spring Boot on a VPS","A Spring Boot application embeds its own server (Tomcat or Undertow) and ships as a standalone executable JAR. This is ideal for a VPS: a single `app.jar` file, one JVM, and you're running. PaaS platforms like Heroku or managed containers bill for every 512 MB slice of RAM, yet the JVM is greedy at startup. On a VPS, you set `-Xmx` yourself, you share the PostgreSQL database and the API on the same machine, and you control the cold warm-up without an imposed timeout. You also keep control over the exact JDK version (Temurin 21 LTS, GraalVM) and over the GC parameters, which is rarely possible in a managed environment.",{"type":35,"title":36,"items":37},"ul","Concrete benefits",[38,39,40,41,42,43],"Full control of the JVM heap (`-Xmx`, `-Xms`) and the garbage collector according to your real load","PostgreSQL database and API co-located: near-zero network latency between the app and the data","Fixed and predictable monthly cost, with no billing per RAM slice or compute time","JDK freedom: Temurin 21 LTS, GraalVM native-image or Azul Zulu according to your needs","No imposed cold start: your service stays warm 24\u002F7 for stable response times","Actuator, Micrometer and Prometheus exposed freely for fine-grained monitoring at no extra cost",{"type":31,"title":45,"body":46},"Hardware and software prerequisites","A Spring Boot API with a database runs comfortably on a VPS with 2 vCPU and 4 GB of RAM (count 1 to 1.5 GB for the JVM, the rest for PostgreSQL and the system). For a lightweight microservice without a heavy ORM, 2 GB is enough but stays tight at startup. Install Docker and Docker Compose, a JDK 21 if you compile on the server (otherwise build the JAR in CI and send only the artifact), and point a domain name such as `api.mydomain.com` at the VPS IP via an A record. Plan for 10 GB of disk minimum for the Docker images and logs.",{"type":48,"title":49,"steps":50},"steps","Step-by-step deployment",[51,54,57,60,63,66],{"title":52,"body":53},"Build the executable JAR","Run `.\u002Fmvnw clean package -DskipTests` (or `.\u002Fgradlew bootJar`). You get a file in `target\u002Fapp.jar` that embeds Tomcat and all the dependencies. Check locally with `java -jar target\u002Fapp.jar` before any upload.",{"title":55,"body":56},"Containerize with a multi-stage Dockerfile","Use `eclipse-temurin:21-jre-alpine` as the final image and copy only the JAR. A multi-stage build (`maven:3.9-eclipse-temurin-21` to compile, JRE to run) reduces the image from 700 MB to about 250 MB. Expose port 8080.",{"title":58,"body":59},"Orchestrate app + PostgreSQL with Docker Compose","Declare two services in `docker-compose.yml`: `app` and `db` (image `postgres:16`). Pass the credentials via environment variables (`SPRING_DATASOURCE_URL`, `SPRING_DATASOURCE_USERNAME`) and link them through an internal network. Run `docker compose up -d`.",{"title":61,"body":62},"Configure Nginx as a reverse proxy","Install Nginx and create a vhost that does a `proxy_pass http:\u002F\u002F127.0.0.1:8080;`. Add the `X-Forwarded-For` and `X-Forwarded-Proto` headers so that Spring correctly detects HTTPS behind the proxy (`server.forward-headers-strategy=framework`).",{"title":64,"body":65},"Enable HTTPS with Certbot","Run `certbot --nginx -d api.mydomain.com` to obtain and install a Let's Encrypt certificate. Automatic renewal is handled by Certbot's systemd timer. Force the HTTP-to-HTTPS redirect in the vhost.",{"title":67,"body":68},"Make restart reliable","Add `restart: unless-stopped` to your Compose services and configure the Actuator healthcheck (`\u002Factuator\u002Fhealth`) as the Docker probe. This way the app restarts on its own after a VPS reboot or a JVM crash.",{"type":70,"body":71},"tip","Compile your application into a native image with GraalVM (`.\u002Fmvnw -Pnative native:compile` via Spring Boot 3): the binary starts in under 100 ms and consumes 3 to 5 times less RAM than a classic JVM. This is decisive on a small VPS where every hundred MB counts. Also limit the heap explicitly with `JAVA_OPTS=-Xmx512m` in Compose to prevent the JVM from claiming all the available memory.","Deploy your Spring Boot API in minutes","The ServOrbit Cloud VPS provides a ready-to-use Docker environment, with dedicated resources and a fixed IP, to run your Spring Boot JAR in production without tedious system configuration.","Discover the Cloud VPS","\u002Fvps-cloud",[77,91,104],{"id":78,"slug":79,"title":80,"excerpt":81,"readTime":82,"views":83,"isPinned":13,"publishedAt":84,"category":85,"categories":86,"featuredImage":23,"bgImage":24,"posterImage":88,"relatedSolution":89},5,"deployer-laravel-vps","Deploying Laravel on a VPS: a production guide","Take Laravel to production on a VPS: PHP, workers, cache, database, reverse proxy and HTTPS configured cleanly.",7,2840,"2026-02-09T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[87],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-laravel-vps-poster.svg",{"categorySlug":20,"appSlug":90},"laravel-stack",{"id":92,"slug":93,"title":94,"excerpt":95,"readTime":11,"views":96,"isPinned":13,"publishedAt":97,"category":98,"categories":99,"featuredImage":23,"bgImage":24,"posterImage":101,"relatedSolution":102},43,"deployer-nodejs-vps","Deploy a Node.js Application on a VPS","Deploy a Node.js application to production on a VPS: PM2, Nginx reverse proxy, Let's Encrypt SSL, and automatic startup at boot.",591,"2026-05-08T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[100],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-nodejs-vps-poster.svg",{"categorySlug":18,"appSlug":103},"nodejs",{"id":105,"slug":106,"title":107,"excerpt":108,"readTime":11,"views":109,"isPinned":13,"publishedAt":110,"category":111,"categories":112,"featuredImage":23,"bgImage":24,"posterImage":114,"relatedSolution":115},44,"deployer-django-vps","Deploy a Django Application on a VPS","Deploy Django on a VPS: Gunicorn, Nginx, PostgreSQL, Docker, and SSL. A complete guide for Python developers who want to self-host.",628,"2026-05-07T00:00:00+00:00",{"id":16,"name":17,"slug":18,"color":19,"icon":20},[113],{"id":16,"name":17,"slug":18,"color":19,"icon":20},"\u002Fblog\u002Fcovers\u002Fdeployer-django-vps-poster.svg",{"categorySlug":18,"appSlug":116},"django",1785628431799]