SET 3 SPRING BOOT READY

myapp_springboot

Cafe24 Dev Language VPS starter environment

Runtime
OpenJDK 21
Framework
Spring Boot 3.5
Database
MariaDB 11.4
Process
systemd (fat JAR)

Start Building (Quickstart)

  1. SSH: ssh root@172.235.194.159
  2. Upload code via SFTP / FileZilla / Cyberduck: host=172.235.194.159, user=root, target=/opt/myapp_springboot/ — include gradlew, gradle/, and build.gradle (or mvnw, pom.xml).
  3. Ownership & permissions: chown -R appuser:appuser /opt/myapp_springbootchmod +x /opt/myapp_springboot/gradlew (SFTP often drops the +x bit.)
  4. Build (Gradle): sudo -iu appusercd /opt/myapp_springboot./gradlew clean bootJar -x testMaven? use ./mvnw -DskipTests package and update ExecStart in the unit file to point at target/*.jar.
  5. Restart: exitsystemctl restart myapp_springboot

Operate (root)

Service statussystemctl status myapp_springboot
App logsjournalctl -u myapp_springboot -f
Healthcurl http://127.0.0.1:8080/actuator/health
DB envsudo cat /etc/myapp_springboot/env

Reference (paths & configs)

RuntimeOpenJDK 21 (Spring Boot 3.x requires JDK 17+)
Build toolGradle wrapper (./gradlew) is preinstalled. Maven (./mvnw) is NOT preinstalled — for a Maven project, upload your own mvnw + .mvn/ + pom.xml via SFTP, then build with ./mvnw -DskipTests package (JAR will land at target/*.jar — update systemd ExecStart accordingly).
JAR location/opt/myapp_springboot/build/libs/*.jar — executable fat JAR; the *-plain.jar variant is skipped.
Service file/etc/systemd/system/myapp_springboot.service (User=appuser, WorkingDirectory=/opt/myapp_springboot)
App config/opt/myapp_springboot/src/main/resources/application.properties (or application.yml)
DB env file/etc/myapp_springboot/env — loaded into systemd via EnvironmentFile=. Read by Spring as DATABASE_URL / DB_USER / DB_PASSWORD env vars.
App port8080 (Spring Boot embedded Tomcat); Nginx reverse-proxies :80 / :443 → :8080
JVM optsedit the unit file: Environment="JAVA_OPTS=-Xmx512m" and change ExecStart to /usr/bin/env java $JAVA_OPTS -jar /opt/myapp_springboot/build/libs/*.jar
Profileadd SPRING_PROFILES_ACTIVE=prod to /etc/myapp_springboot/env, or pass --spring.profiles.active=prod in ExecStart.
Redeployupload new source → ./gradlew clean bootJar -x test as appuser → systemctl restart myapp_springboot as root.