set port for spring boot application code example Example 1: spring port server.port=8081 Example 2: change port in spring boot server.port=8081