Change Port on a Spring Boot Application when using intelliJ

Change Port on a Spring Boot Application when using intelliJ 

Two ways to change the port that the embedded Tomcat is using in a Spring Boot Application.

The first way is to modify the application properties in the resources folder:

Update application properties to change port
Update application props in Spring Boot Application

There are a couple issues with this approach.  You might only want this port change in your local environment and if you check it in by accident you might break things.

Alternatively, you can use a command line parameter.

Go to Run -> Edit Configurations -> VM options

Then enter in the following argument:


Then click apply and OK and attempt to run the application again.

Update port on Spring Boot application using VM option
Update port using VM option

Popular posts from this blog

How to set up a SQL Server 2008 Local Database

Spring Boot Internationalization with Default Locale for Message Strings