How do you enable Actuator in Spring Boot?

Spring Boot Actuator can be enabled by adding the Actuator starter dependency to the project. Once enabled, it provides production-ready endpoints that help monitor, manage, and inspect the application's health, metrics, configuration, and runtime behavior.

Key Points

Why Do We Need Actuator?

In production environments, developers and administrators often need to know:

Actuator provides this information without writing custom monitoring code.

Step 1: Add Actuator Dependency

Maven Dependency

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

After adding the dependency, Spring Boot automatically configures Actuator.

Step 2: Expose Actuator Endpoints

By default, only a few endpoints are exposed.

application.properties

management.endpoints.web.exposure.include=*

This exposes all available Actuator endpoints.

To expose specific endpoints only

management.endpoints.web.exposure.include=health,info,metrics

This is the recommended approach for production systems.

Step 3: Access Endpoints

After starting the application

Health Endpoint

http://localhost:8080/actuator/health

Info Endpoint

http://localhost:8080/actuator/info

Metrics Endpoint

http://localhost:8080/actuator/metrics

Beans Endpoint

http://localhost:8080/actuator/beans

Environment Endpoint

http://localhost:8080/actuator/env

Example Response

Health Endpoint

{

status": "UP

}

This indicates that the application is running successfully.

How It Works Internally

Application Starts

|

Actuator Dependency Detected

|

Auto-Configuration Applied

|

Management Endpoints Created

|

Endpoints Exposed

|

Monitoring Available

Spring Boot automatically registers the Actuator endpoints during startup.

Commonly Used Actuator Endpoints

These endpoints provide valuable runtime information.

Example

Suppose an Employee Management System is deployed to production.

Operations Team wants to verify

Instead of writing custom APIs, they can use

/actuator/health

/actuator/metrics

/actuator/beans

provided by Spring Boot Actuator.

Security Consideration

In production

Avoid exposing all endpoints publicly.

Instead

management.endpoints.web.exposure.include=health,info

Sensitive endpoints such as

should usually be protected with Spring Security.

Benefits of Actuator

Real-World Example

In a microservices architecture, Kubernetes often uses

/actuator/health

to determine whether a service is healthy and ready to receive traffic.

Monitoring tools such as

can collect metrics from Actuator endpoints for real-time monitoring.

Common Mistakes

Follow-up Questions

Interview Tip

A concise interview answer is

To enable Actuator in Spring Boot, add the spring-boot-starter-actuator dependency. Spring Boot automatically configures management endpoints such as health, metrics, and info. We can control which endpoints are exposed using the management.endpoints.web.exposure.include property in application.properties or application.yml.

Last updated: 11 November 2026

Previous question: What is Spring Boot Actuator?

Next question: How do you list all the beans in a Spring Boot application?

More Spring Boot - Level I interview questions

All Spring Boot - Level I questions