To perform a graceful shutdown in Spring Boot, enable the spring.lifecycle.timeout-per-shutdown-phase property and the server.shutdown property in the application.properties or application.yml file. This will allow the application to complete ongoing requests and close resources before shutting down. Reference: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-graceful-shutdown