When we start the application Spring Boot’s inbuilt tomcat server by default will take 8080 as its port number, did you observe that 🙂 go back and have a look once. In this article, I am going to show you how to change that default tomcat’s port number 8080 to something else.

In Spring Boot, we can change tomcat’s port number just by adding 1 line in application.properties.


server.port = 2019

A single line server.port will change the Spring Boot tomcat’s port number, if you run the application the server will takes 2019 as its port number, you can check the port in the console and can execute the application.