In spring , we can configure the default port by setting the specific property when starting the application or by customizing the embedded server configuration.

For that, we will set our @SpringBootApplication class :

public class CustomApplication {
    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(CustomApplication.class);
          .singletonMap("server.port", "8083"));;

Here we changed the default Tomcat port 8080 to 8083. We can use a Command-Line Arguments to change the default port .


  1. Pingback: (Solved) How to Change the Default Port in Spring Boot ? » JavaTuto

Laisser un commentaire