Spring Boot — Tomcat Port Number | Code Factory

Reference Link : Link

Donate : Link

Spring Boot lets you to run the same application more than once on a different port number.
Note : Default port number 8080.

Custom Port

server.port = 8081

In the application.yml file, you can find as follows

server: 
port: 8081

Random Port

server.port = 0

In the application.yml file, you can find as follows

server: 
port: 0

Note − If the server.port number is 0 while starting the Spring Boot application, Tomcat uses the random port number.