When I run my Quarkus application it listens/binds to localhost only by default.
How can I alter this behavior?
UPDATE
With the inclusion of this PR in Quarkus, starting with version 0.12.0
the configuration explained in the following section will no longer be needed since Quarkus will use 0.0.0.0
as the default host.
By default Quarkus only listens on localhost (127.0.0.1). To make Quarkus listen on all network interfaces (something that is very handy for example when running inside a Docker container or Kubernetes Pod), the quarkus.http.host
property needs to be set.
If you always want your Quarkus application to listen on all interfaces you can set
quarkus.http.host=0.0.0.0
in your application.properties
(under src/main/resources
).
If you would rather keep the default setting and only override at runtime, you can do that as follows:
When running a Quarkus application in JVM mode you can set the port using the quarkus.http.host System property to 0.0.0.0. For example:
java -Dquarkus.http.host=0.0.0.0 -jar example-runner.java
The same property applies to GraalVM Native Mode images. For example:
./example-runner -Dquarkus.http.host=0.0.0.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With