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