Generally, we are proving spring boot application HTTP Server port using server.port in the files but if we have thousand of microservices at that time we do not like to specified service port manually instead we like to random generated free port should be automatically taken by spring boot application.

NOTE: Application will automatically take free port from OS.

Spring boot random server port can be assigned0 to server.port  in or application.yml

server.port=0   // for spring boot server port random


  port: 0          // for spring boot server port random


Spring boot server port document

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *