run spring boot application from command line with port number code example Example 1: change port number in sts server.port=8081 Example 2: change spring port server.port=8081