How to bind WildFly to an IP address

This tutorial discusses how to set WildFly bind address using command line arguments and the configuration file. It applies to all WildFly versions and JBoss EAP as well.

WildFly application server and JBoss EAP include two network interfces . There are two interfaces: “public” and “management”:

<interfaces>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
        </interface>
        <interface name="public">
            <inet-address value="${jboss.bind.address:127.0.0.1}"/>
        </interface>
    </interfaces>
  • The “public” interface is used for all application related network communication.
  • The “management” interface is used for all components and services that are required by the management layer (i.e. the CLI or the Web Console).

By default, the “public” interface and the “management” interface are configured to listen on the loopback address of 127.0.0.1, as you can see from the following picture:

wildfly bind address jboss bind address

Therefore, in the default configuration, WildFly home page can be accessed at http://127.0.0.1:8080

The simplest way to change the “public” address is passing the -b argument while starting the server like:

$ ./standalone.sh -c standalone-full.xml -b=192.168.10.1

Please note that “-b” is an alias for the property “jboss.bind.address“:

$ ./standalone.sh -Djboss.bind.address=192.168.10.1

You can also hardcore the IP/Hostname in the XML configuration file. In this case, however, it is recommended to include as default the property jboss.bind.address and add, as fallback address, the hostname or IP Address:

<interface name="public">
    <inet-address value="${jboss.bind.address:192.168.10.1}"/>
</interface>

On the other hand, if you want bind also the WildFly’s management console, you can use the -bmanagement property as follows:

$ .standalone.sh -bmanagement=192.168.10.1 -Djboss.bind.address=192.168.10.1

Now you can connect to the CLI management interface using the IP Address:

$ ./jboss-cli.sh --connect controller=192.168.10.1

Binding WildFly to all available IP Addresses

If you want to bind WildFly to all available IP addresses, then execute:

$ ./standalone.sh -b=0.0.0.0

You can also bind the “management” interface to all available IP addresses as:

$ ./standalone.sh -bmanagement=0.0.0.0

And of course, you can bind both interfaces as:

$ ./standalone.sh -b=0.0.0.0 -bmanagement=0.0.0.0

IMPORTANT: Binding JBoss to all IP addresses is not recommended for production systems due to a lack of security.

Binding WildFly with Docker

If you are running WildFly with Docker, then you can choose the bind address by passing the above properties to the Docker process as follows:

docker run -p 8080:8080 -p 9990:9990 -it jboss/wildfly /opt/jboss/wildfly/bin/standalone.sh -bmanagement=0.0.0.0 -b 0.0.0.0

If you want to read how to configure the Port of WildFly, check this tutorial: Configuring port offset on JBoss AS / WildFly

Found the article helpful? if so please follow us on Socials