How do I run the same application twice in IntelliJ?

You can copy the run configuration of your client, give it a different name and leave all other parameters unchanged. Then you'll be able to select the two copies in the "Compound" run configuration.


I had same problem with Intellij 2018.2.5 and solved it by uncheck "single instance only" check box in "run/debug configuration."

By the way each time I run Spring class (that have main method) new instance will be created.

The important point is never forget that we can't run application on same port. so it's necessary to set server.port = 0 in application.properties to run application on random port. enter image description here


Click Run->Edit Configurations. For the file requiring multiple instances, click on Allow parallel run. You can do this for multiple files. Click on Apply. enter image description here