Which embedded servers does Spring Boot support, and which one is the default?

Spring Boot provides built-in embedded web servers that allow applications to run independently without requiring deployment to an external application server. These servers are packaged with the application and start automatically when the application launches. By default, Spring Boot uses Apache Tomcat as its embedded server.

Key Points

Why Are Embedded Servers Important?

In traditional Java web applications

Examples

Spring Boot simplifies this process by embedding the server inside the application itself.

Application

|

Embedded Server

|

Ready to Run

Run Command

java -jar application.jar

No separate server installation is required.

Embedded Servers Supported by Spring Boot

1. Apache Tomcat (Default)

Tomcat is the default embedded server used by Spring Boot.

Features

Dependency

spring-boot-starter-web

When this starter is added, Tomcat is automatically included.

2. Jetty

Jetty is an alternative embedded web server.

Features

Often used in

3. Undertow

Undertow is a high-performance web server developed by Red Hat.

Features

Often preferred for

How to Change the Default Server?

By default

spring-boot-starter-web

includes Tomcat.

To use Jetty

Exclude Tomcat and add

spring-boot-starter-jetty

Example

<dependency>
    <groupId>
        org.springframework.boot
    </groupId>
    <artifactId>
        spring-boot-starter-web
    </artifactId>

    <exclusions>
        <exclusion>
            <groupId>
                org.springframework.boot
            </groupId>
            <artifactId>
                spring-boot-starter-tomcat
            </artifactId>
        </exclusion>
    </exclusions>
</dependency>

<dependency>
    <groupId>
        org.springframework.boot
    </groupId>
    <artifactId>
        spring-boot-starter-jetty
    </artifactId>
</dependency>

Similarly, Undertow can be used by adding

spring-boot-starter-undertow

Example

Suppose you create a REST API using

spring-boot-starter-web

When the application starts

@SpringBootApplication
public class Application {

    public static void main(String[] args) {

        SpringApplication.run(
                Application.class,
                args);
    }
}

Spring Boot automatically

No external deployment is required.

Comparison of Embedded Servers

Tomcat

Jetty

Undertow

Benefits of Embedded Servers

Real-World Example

In a microservices environment

Each service can be packaged as

application.jar

When deployed

This is one of the major reasons Spring Boot became popular for cloud-native and microservice-based architectures.

Interview Tip

A concise interview answer is

Spring Boot supports embedded servers such as Apache Tomcat, Jetty, and Undertow. By default, Spring Boot uses Apache Tomcat when the spring-boot-starter-web dependency is included. These embedded servers allow applications to run as standalone JAR files without requiring deployment to an external application server.

Last updated: 11 November 2026

Previous question: How does Swagger help in documenting APIs?

Next question: How does Spring Boot decide which embedded server to use if multiple options are available in the classpath?

More Spring Boot - Level I interview questions

All Spring Boot - Level I questions