How can I configure the port a Quarkus application runs on?

geoand picture geoand · Mar 7, 2019 · Viewed 6.9k times · Source

I would like my Quarkus application to run on a port other than the default. How can I accomplish that?

Answer

geoand picture geoand · Mar 7, 2019

The Quarkus configuration property to be used is quarkus.http.port (the default value is 8080). If this property is set in application.properties then that value will be used.

The property can also be overridden at runtime as follows:

When running a Quarkus application in JVM mode you can set the port using the quarkus.http.port System property. For example:

java -Dquarkus.http.port=8081 -jar example-runner.java

The same property applies to GraalVM Native Mode images. For example:

./example-runner -Dquarkus.http.port=8081