**Primary keywords:** java hosting, spring boot hosting, deploy spring boot, java cloud hosting, managed java hosting
---
Spring Boot is one of the most widely used backend frameworks in enterprise and startup environments alike. The "just run the jar" deployment model made Java server hosting much simpler than the WAR/application-server era — but getting that JAR into a reliable cloud environment still involves more setup than it should. This guide covers managed Spring Boot hosting and how to deploy Java applications without touching server configuration.
## The Spring Boot Deployment Model
Spring Boot embeds an application server (Tomcat by default) inside your JAR file, so running a Spring Boot app is as simple as:
```bash
java -jar myapp.jar
```
The challenge is everything around that command: the JVM must be available, the right Java version must match your build target, environment variables need to be injected, ports need to be configured, and the process needs to survive crashes and deploys. rails production hostingmanaged cloud hosting platform Managed hosting handles all of this.
## Preparing a Spring Boot App for Deployment
### Build Configuration
For Maven:
```xml
org.springframework.boot
spring-boot-maven-plugin
```
For Gradle:
```kotlin
// build.gradle.kts
plugins
id("org.springframework.boot") version "3.2.0"
id("java")
```
### application.properties (Production-Ready)
```properties
# application.properties
server.port=$PORT:8080
spring.datasource.url=$DATABASE_URL
spring.datasource.username=$DB_USER
spring.datasource.password=$DB_PASSWORD
spring.jpa.hibernate.ddl-auto=validate
logging.level.root=INFO
```
Using `$PORT:8080` means the app binds to the `PORT` environment variable when set, falling back to 8080 for local development. wordpress migration hosting ApexWeave injects `PORT` automatically.
### Procfile
```
web: java -jar target/myapp-0.0.1-SNAPSHOT.jar
```
Or with JVM tuning flags:
```
web: java -Xmx512m -Xms256m -XX:+UseContainerSupport -jar target/myapp-0.0.1-SNAPSHOT.jar
```
`-XX:+UseContainerSupport` is important — it makes the JVM respect container memory limits rather than using total host memory for heap sizing.
## Deploying to ApexWeave
```bash
# Build your JAR locally first
mvn clean package -DskipTests
# Or: . visit site /gradlew bootJar
# Log in and deploy
apexweave login
apexweave deploy
```
ApexWeave detects a Java project from your `pom.xml` or `build.gradle`, runs the appropriate build command, and starts the process from your `Procfile`.
## Setting Environment Variables
```bash
apexweave env:set DATABASE_URL=jdbc:postgresql://host:5432/mydb
apexweave env:set DB_USER=myapp
apexweave env:set DB_PASSWORD=secure-password
apexweave env:set SPRING_PROFILES_ACTIVE=production
apexweave env:set JWT_SECRET=your-256-bit-secret
```
In your application:
```java
@Value("$jwt.secret:$JWT_SECRET")
private String jwtSecret;
// Or using @ConfigurationProperties
@ConfigurationProperties(prefix = "spring.datasource")
public class DataSourceProperties
private String url;
private String username;
private String password;
```
## A Minimal Spring Boot REST Controller
```java
@RestController
@RequestMapping("/api")
public class AppController
@GetMapping("/health")
public ResponseEntity> health()
return ResponseEntity.ok(Map.of(
"status", "ok",
"env", System.getenv().getOrDefault("SPRING_PROFILES_ACTIVE", "default")
));
@GetMapping("/users")
public List getUsers()
return userService.findAll();
```
## Spring Boot Actuator for Health Checks
Add Actuator to expose a health endpoint ApexWeave can probe:
```xml
org.springframework.boot
spring-boot-starter-actuator
```
```properties
management.endpoints.web.exposure.include=health,info
management.endpoint.health.show-details=when_authorized
```
## Java Version Selection
Specify the Java version in your `pom.xml`:
```xml
21
```
ApexWeave provisions the matching JDK. Java 21 with virtual threads (Project Loom) is an excellent choice for I/O-heavy Spring Boot apps.
## Spring Boot with Virtual Threads (Java 21)
```properties
# application.properties
spring.threads.virtual.enabled=true
```
With this single property, Spring Boot uses virtual threads for all Tomcat request handling, dramatically improving throughput under concurrent load without increasing memory usage.
## Database Migrations with Flyway
```xml
org.flywaydb
flyway-core
```
```
# src/main/resources/db/migration/V1__create_users.sql
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT NOW()
);
```
Flyway runs migrations at startup before the application accepts traffic — a safe pattern for zero-downtime deploys.
## Streaming Logs
```bash
apexweave logs --follow
```
Spring Boot's structured logging output streams here. click here Set your log level:
```bash
apexweave env:set LOGGING_LEVEL_COM_YOURPACKAGE=DEBUG
```
## SSH Access
```bash
apexweave ssh
# Check the Java version in production
java -version
# Look at heap usage
jcmd 1 VM.native_memory
```
## Plan Recommendations
Java's JVM has a meaningful base memory footprint. nodejs hosting platform 2025 Factor this into plan selection:
- **AppForge Starter ($5/mo):** Small Spring Boot apps, internal tools, low-traffic APIs
- **AppForge Pro ($10/mo):** Production APIs, Spring Boot + database backends
- **AppForge XL ($15/mo):** High-traffic services, apps with background processing, memory-intensive workloads
## Comparing to Running on a VPS
On a VPS you'd configure a systemd unit file, manage JDK installations with SDKMAN, set up log rotation, configure firewall rules, and handle SSL. With ApexWeave, you `mvn package` and `apexweave deploy`. The platform manages the runtime environment; you manage the application.
Start your free 7-day ApexWeave trial today and deploy your Spring Boot application to a production HTTPS URL. No server configuration, no DevOps overhead — just `apexweave deploy`.