Bind WildFly to a different IP address, or all addresses on multihomed
InterfaceĀ is a logical name, in WildFly parlance, for a network interface/IP address/host name to which sockets can be bound.Ā There are two interfaces:Ā āpublicāĀ and āmanagementā.
The āpublicā interface binding is used for allĀ application related network communication (i.e. Web, Messaging, etc). The āmanagementā interface is used for all components and services that are required by the management layer (i.e. the HTTP Management Endpoint).
By default, āpublicā interfaceĀ isĀ configured to listen on the loopback address of 127.0.0.1. So if you start WildFly as:
./bin/standalone.sh
ThenĀ WildFly default page can be accessed as http://127.0.0.1:8080. Usually, /etc/hosts provide a mapping of 127.0.0.1 to localhost, and so the same page is accessible at http://localhost:8080. 8080 is the portĀ where all applications are accessed.
On a multihomed machine, you may like toĀ start WildFly and bind āpublicā interface to a specific IP address. This can be easily done as:
./bin/standalone.sh -b=192.168.1.1
Now the applications can be accessed at http://192.168.1.1:8080.
For compatibility, -b 192.168.1.1 is also supported but -b=192.168.1.1 is recommended.
Or, if you want to bind to allĀ available IP addresses, then you can do:
./bin/standalone.sh -b=0.0.0.0
Similarly, by default,Ā WildFly can be managed using Admin Console at http://127.0.0.1:9990.Ā 9990 is the management port.
WildFly āmanagementā interface can be bound to a specific IP address as:
./bin/standalone.sh -bmanagement=192.168.1.1
Now AdminĀ Console can be accessed at http://192.168.1.1:9990.
Or, bind āmanagementā interface to all available IP addresses as:
./bin/standalone.sh -bmanagement=0.0.0.0
You can also bind to two specific addresses as explained here.
Of course, you can bind WildFly āpublicā and āmanagementā interface together as:
./bin/standalone.sh -b=0.0.0.0 -bmanagement=0.0.0.0
Learn more about it Interface and Port Configuration in WildFly. And more about these switches in Controlling the Bind Address with -b.
| Reference: | Bind WildFly to a different IP address, or all addresses on multihomed from our JCG partner Arun Gupta at the Miles to go 2.0 ⦠blog. |




