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:

<dependency>
  <groupId>de.codecentric</groupId>
  <artifactId>spring-boot-admin-starter-server</artifactId>
  <version>3.2.3</version>
</dependency>

Enable the admin server:

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

After starting, the server UI is accessible.

2.2 Client Side

Add the client and required dependencies:

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

Configure the client to point to the server:

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

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.

@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();
  }
}

Define default credentials:

spring:
  security:
    user:
      name: admin
      password: xxxooo
      roles:
        - USER
        - MGR

Now the server UI requires login.

2.4 Custom UI

External Links

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

Dropdown Menu

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

Logo and Title

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

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

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

monitoringsecurityspring-bootspring-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

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.