How do I configure the TCP/IP port listened on by a Spring Boot application, so it does not use the default port of 8080.
Home/server
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Option 1: s said in docs either set server.port as system property using command line option to jvm -Dserver.port=8090 or add application.properties in /src/main/resources/ with server.port=8090 For a random port use: server.port=0 Similarly add application.yml in /src/main/resources/ with: server:Read more
Option 1:
s said in docs either set
server.port
as system property using command line option to jvm-Dserver.port=8090
or addapplication.properties
in/src/main/resources/
withFor a random port use:
Similarly add
application.yml
in/src/main/resources/
with:Option 2:
You can configure the port programmatically.
For Spring Boot 2.x.x:
For older versions:
See less