Spring boot actuator /health is not working
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
When someone says "Spring Boot actuator /health is not working," the first thing to check is the actual endpoint path. In modern Spring Boot versions, the health endpoint is exposed at /actuator/health by default, so a request to plain /health usually fails unless you have customized the base path or mapped a health group to an additional path.
Start with the Dependency
The health endpoint does not exist unless Actuator is on the classpath.
For Gradle:
For Maven:
If that dependency is missing, no actuator endpoints will appear regardless of your properties.
Use the Right URL
In current Spring Boot, the default health URL is:
Test it directly:
If you are trying http://localhost:8080/health and expecting it to work automatically, that mismatch alone may be the entire problem.
Check Exposure and Port Configuration
Actuator endpoints can be exposed on the main server port or a separate management port. They can also live under a customized base path.
Typical properties:
With that configuration, the health endpoint is on port 8081, not the main application port:
Many "not working" reports turn out to be requests sent to the wrong port or wrong base path.
Security Can Block It
If Spring Security is present and you define your own SecurityFilterChain, you are responsible for allowing access to the health endpoint if that is what you want.
A simple Boot 3 style example:
Without the right security rule, the endpoint may exist but return 401 or 403.
If You Really Need /health
If your infrastructure expects /health specifically, you can expose a health group at an additional path on the main server port.
That gives you a dedicated /health path while preserving normal actuator conventions.
Look at the Logs and Response Code
The HTTP status code tells you a lot:
- '
404usually means wrong path, missing dependency, or wrong port' - '
401or403usually means security configuration' - '
503means the endpoint exists but one or more health indicators report a failing status'
Those are very different problems, so do not debug them the same way.
Common Pitfalls
The most common mistake is assuming the endpoint path is /health in all Spring Boot versions. For modern setups, /actuator/health is the default, and that difference matters immediately.
Another issue is forgetting that custom management ports and base paths change where the endpoint is served. If the application is on port 8080 and management is on 8081, probing the wrong port will always look broken.
Finally, teams often add a custom SecurityFilterChain and then assume Spring Boot will still expose health anonymously by magic. Once you take over security configuration, you must define the actuator access rules yourself.
Summary
- In modern Spring Boot, the default health URL is
/actuator/health. - Make sure
spring-boot-starter-actuatoris included. - Check management port, base path, and endpoint exposure settings.
- Inspect security rules if the endpoint returns
401or403. - Use an additional health-group path only if your infrastructure truly requires
/health.
Related reading
- Spring Boot Actuator Health Returning DOWN
- Spring Boot Actuator hides property values in env endpoint
- Spring Boot Actuator to run in separate thread pool
- Spring Boot Actuator without Spring Boot
- Spring Boot application in eclipse, the Tomcat connector configured to listen on port XXXX failed to start
- Spring Boot application.properties value not populating
- Spring Boot Adding Http Request Interceptors
- Spring Boot Adding Http Request Interceptors

OOD Fundamentals
Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.