Backend Development 8 min read

Master Spring Boot Admin 3.2.3: Setup, Security, and Custom UI

This guide walks you through installing Spring Boot Admin 3.2.3, configuring both server and client sides, securing the dashboard with Spring Security, and customizing the UI with external links, dropdown menus, and branding.

Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Master Spring Boot Admin 3.2.3: Setup, Security, and Custom UI

1. Introduction

Spring Boot Admin is a monitoring tool that visualizes information provided by Spring Boot Actuators in a user‑friendly UI. It consists of a server that displays actuator data and a client that registers with the server.

2. Practical Example

2.1 Server Side

Add the starter dependency:

<code>&lt;dependency&gt;
  &lt;groupId&gt;de.codecentric&lt;/groupId&gt;
  &lt;artifactId&gt;spring-boot-admin-starter-server&lt;/artifactId&gt;
  &lt;version&gt;3.2.3&lt;/version&gt;
&lt;/dependency&gt;</code>

Enable the admin server:

<code>@SpringBootApplication
@EnableAdminServer
public class SpringbootAdminServerApplication {
  public static void main(String[] args) {
    SpringApplication.run(SpringbootAdminServerApplication.class, args);
  }
}</code>

After starting, the server UI is accessible.

2.2 Client Side

Add the client and required dependencies:

<code>&lt;dependency&gt;
  &lt;groupId&gt;de.codecentric&lt;/groupId&gt;
  &lt;artifactId&gt;spring-boot-admin-starter-client&lt;/artifactId&gt;
  &lt;version&gt;3.2.3&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
&lt;/dependency&gt;</code>

Configure the client to point to the server:

<code>server:
  port: 8081
---
management:
  endpoints:
    web:
      base-path: /ac
      exposure:
        include: '*'
  info:
    env:
      enabled: true
---
spring:
  boot:
    admin:
      client:
        url: http://localhost:8080
        instance:
          service-url: http://localhost:8081</code>

After registration, you can view the instance list and details:

2.3 Security Configuration

Spring Boot Admin does not provide a default authentication method; you need to add spring-boot-starter-security and configure it.

<code>@Configuration
public class SecurityConfig {
  private final AdminServerProperties adminServer;
  private final SecurityProperties security;

  public SecurityConfig(AdminServerProperties adminServer, SecurityProperties security) {
    this.adminServer = adminServer;
    this.security = security;
  }

  @Bean
  SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
    http.csrf(configurer -> configurer.disable());
    SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
    successHandler.setTargetUrlParameter("redirectTo");
    successHandler.setDefaultTargetUrl(this.adminServer.path("/"));
    http.authorizeHttpRequests(registry -> {
      registry.requestMatchers(new AntPathRequestMatcher(this.adminServer.path("/assets/**"))).permitAll();
      registry.requestMatchers(new AntPathRequestMatcher(this.adminServer.path("/actuator/info"))).permitAll();
      registry.requestMatchers(new AntPathRequestMatcher(adminServer.path("/actuator/health"))).permitAll();
      registry.requestMatchers(new AntPathRequestMatcher(this.adminServer.path("/login"))).permitAll();
      registry.anyRequest().authenticated();
    });
    http.formLogin(configurer -> {
      configurer.loginPage(this.adminServer.path("/login")).successHandler(successHandler);
    });
    http.logout(configurer -> {
      configurer.logoutUrl(this.adminServer.path("/logout"));
    });
    // used for client registration (basic auth)
    http.httpBasic(withDefaults());
    return http.build();
  }

  @Bean
  InMemoryUserDetailsManager userDetailsService() {
    org.springframework.boot.autoconfigure.security.SecurityProperties.User u = this.security.getUser();
    UserDetails user = User.withUsername(u.getName())
        .password(u.getPassword())
        .roles(u.getRoles().toArray(new String[0]))
        .build();
    return new InMemoryUserDetailsManager(user);
  }

  @Bean
  PasswordEncoder passwordEncoder() {
    return NoOpPasswordEncoder.getInstance();
  }
}
</code>

Define default credentials:

<code>spring:
  security:
    user:
      name: admin
      password: xxxooo
      roles:
        - USER
        - MGR</code>

Now the server UI requires login.

2.4 Custom UI

External Links

<code>spring:
  boot:
    admin:
      ui:
        external-views:
          - label: "Spring全家桶实战案例源码"
            url: "http://www.pack.com"
            order: 2000</code>

Dropdown Menu

<code>spring:
  boot:
    admin:
      ui:
        - label: Spring导航
          children:
            - label: "📖 xg"
              url: http://www.xg.com
            - label: "📦 pack"
              url: http://www.pack.com
            - label: "🐙 Spring"
              url: https://www.spring.io
          order: 2000</code>

Logo and Title

<code>spring:
  boot:
    admin:
      ui:
        title: 项目实时监控
        brand: '<img src="/res/xg.svg">'
---
spring:
  mvc:
    static-path-pattern: /res/**</code>

For more UI customization details, refer to the official documentation.

JavamonitoringSpring BootsecuritySpring Boot Admincustom UI
Spring Full-Stack Practical Cases
Written by

Spring Full-Stack Practical Cases

Full-stack Java development with Vue 2/3 front-end suite; hands-on examples and source code analysis for Spring, Spring Boot 2/3, and Spring Cloud.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.