Spring Boot server delivers a streamlined way to build and run Java web applications. It embeds Tomcat, Jetty, or Undertow, so you can start coding endpoints and services without wrestling with servlet container setup.
With production-ready features like health checks, metrics, and external configuration, Spring Boot server is a pragmatic choice for modern microservices and monoliths alike.
| Aspect | Embedded Server | Traditional Deployment | Cloud Native Behavior |
|---|---|---|---|
| Runtime | Runs inside the application with an embedded container | Deploys a WAR to an external servlet container | Container-friendly, often used with Docker and Kubernetes |
| Configuration | Port, context path, and connectors set via application.properties or YAML | Managed at the container level (server.xml, context files) | Defined via environment variables and service bindings |
| Startup | Single java -jar command starts server and application | Separate steps to start container and deploy artifact | Fast startup ideal for autoscaling and ephemeral pods |
| Monitoring | Built-in Actuator endpoints for metrics, health, and info | Monitoring configured at container or load balancer level | Integrated with platform metrics, tracing, and service mesh |
Embedded Tomcat as the Default Spring Boot server
By default, Spring Boot uses an embedded Tomcat instance, removing the need for manual Tomcat installation and war file deployment. You simply package your application as a jar and run it, and the server starts on the configured port automatically.
Spring Boot auto-configures connectors, threads, and lifecycle settings based on your dependencies and property overrides. This keeps the developer experience smooth while still allowing deep tuning of max threads, accept count, and connection timeouts when needed.
Because the server lives inside the jar, it aligns perfectly with immutable deployments and container images. You gain consistent behavior across local machines, CI pipelines, and production clusters with minimal environment-specific setup.
Customizing HTTP and SSL on the embedded server
You can customize HTTP settings in application.properties or application.yml, such as server.port, server.address, and server.error.include-message. For SSL, set server.ssl.key-store, server.ssl.key-store-password, and related properties to enable HTTPS without external proxies.
Spring Boot also supports multiple connectors, allowing you to serve HTTP on one port and HTTPS on another, or to add a management-specific port for Actuator traffic. With servlet initializers and filters, you can further tailor request handling and security at the server level.
These configuration-driven options reduce XML and boilerplate, enabling quick environment switches between dev, staging, and production while preserving fine-grained control over networking behavior.
Reactive stack with embedded Reactor Netty
For non-blocking, event-driven workloads, Spring Boot can start an embedded Reactor Netty server instead of Tomcat. This suits WebFlux applications that rely on reactive streams and backpressure to handle high concurrency with few threads.
You get responsive, low-latency request processing and efficient resource usage, especially for long-lived connections such as Server-Sent Events or WebSockets. The same externalized configuration style applies, keeping the developer experience consistent across stack choices.
Switching between embedded servlet and reactive servers is mostly a matter of dependencies and annotated main classes, letting teams adopt reactive patterns incrementally without massive rewrites. monitoring and tuning differ slightly, but the operational benefits remain aligned with cloud native practices.
Production readiness and lifecycle management
Spring Boot server includes production-ready features such as graceful shutdown, application lifecycle timeout settings, and detailed health indicators. These help orchestration platforms perform rolling updates and terminate unhealthy pods cleanly.
Actuator endpoints expose metrics, thread pool status, and JVM details, often integrated with Prometheus, Grafana, or other monitoring systems. Combined with structured logging and distributed tracing, you gain full visibility into request flows and bottlenecks.
By externalizing configuration and supporting profile-specific property sources, Spring Boot server simplifies environment management and reduces the risk of misconfigured deployments across the stack.
Embracing cloud native patterns with Spring Boot server
Spring Boot server fits naturally into containerized environments, supporting rapid scale, rolling updates, and immutable infrastructure. Its embedded model and actuator ecosystem simplify observability and reliability in dynamic orchestration platforms.
As teams evolve toward service meshes and progressive delivery, the server remains a flexible foundation that can adapt to shifting networking, security, and deployment requirements with minimal friction.
- Use embedded servers to simplify deployment and achieve consistent behavior across environments.
- Leverage externalized configuration for port, SSL, and context path settings.
- Tune thread pools and timeouts to match your workload and performance targets.
- Combine Actuator, metrics, and tracing for robust observability in production.
- Choose servlet or reactive stacks based on latency, throughput, and programming model needs.
FAQ
Reader questions
How do I change the port and context path for the embedded server in Spring Boot?
Set server.port and server.servlet.context-path in application.properties or application.yml to control the listening port and context path for the embedded server.
Can I disable the embedded Actuator endpoints on the Spring Boot server?
Yes, manage exposure via management.endpoints.web.exposure.include and management.endpoints.web.exposure.exclude in your configuration to control which endpoints are available.
What happens if two services in Kubernetes try to bind to the same server port in their Spring Boot images?
Kubernetes will prevent the second pod from starting if the node port is already bound, so ensure port assignments are unique via Service definitions or use headless services with dynamic allocation.
How can I enable HTTPS with a custom keystore on the embedded server?
Configure server.ssl.key-store, server.ssl.key-store-password, server.ssl.key-store-type, and server.ssl.key-alias in your properties file to enable HTTPS with a custom keystore.