WildFly , formerly known as JBoss is a cross-platform open-source application runtime written in Java. WildFly is flexible, lightweight, and it is based on pluggable subsystems that can be added or removed as needed.
Install Java OpenJDK
OpenJDK is the open-source implementation of the Java Platform which is the default Java development and runtime in CentOS 7.
Install the OpenJDK package by running:
yum install java-11-openjdk-devel
You can verify the installation, by running the following command which will print the Java version:
Create a User
Running WildFly as the root user is a security risk and not considered best practice.
First, we need to create a folder to WildFly:
We need to create a new user and group named
wildfly with home directory
> groupadd -r wildfly > useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly
In order to install the latest version of WildFly, please check the following link: Download WildFly.
Download the WildFly archive in the
/tmp directory using the following
wget https://download.jboss.org/wildfly/21.0.1.Final/wildfly-21.0.1.Final.tar.gz -P /tmp
When the download is completed, unpack the tar.gz file and move it to the
tar xf /tmp/wildfly-21.0.1.Final.tar.gz -C /opt/
Next, create a symbolic link
wildfly that will point to the WildFly installation directory:
ln -s /opt/wildfly-21.0.1.Final /opt/wildfly
WildFly will run under the
wildfly user which needs to have access to the WildFly installation directory.
Change the directory ownership to user and group
wildfly with the following chown command :
chown -RH wildfly: /opt/wildfly
1 – First, we need to create a directory which will hold the WildFly configuration file:
mkdir -p /etc/wildfly
2 – Then, copy the configuration file to that
cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/
This file allows you to specify the WildFly mode and bind address.
By default, WildFly will run in a standalone mode and will listen on all interfaces.
You can edit the file according to your needs.
3 – Next, copy the WildFly
launch.sh script to the
cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/
The scripts inside
bin directory must have executable flag:
sh -c 'chmod +x /opt/wildfly/bin/*.sh'
4 – Copy the systemd unit file named to the
cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/
Notify systemd that we created a new unit file:
5 – Start the WildFly service an enable it to be automatically started at boot time by running:
systemctl start wildfly
systemctl enable wildfly
6 – Verify that the service is running:
systemctl status wildfly
Open the firewall port for the WildFly
we need to open the following port to be able to access the WildFly from outside:
firewall-cmd --zone=public --permanent --add-port=8080/tcp firewall-cmd --reload
Test the WildFly Installation
To access the default WildFly page, open your browser and type:
Configure WildFly Authentication
Now that WildFly is installed and running the next step is to create a user who will be able to connect using the administration console or remotely using the CLI.
To add a new user use the
add-user.sh script that is located the WildFly’s bin directory:
You’ll be asked what type of user do you wish to add
a and hit
Next, the script will prompt you to enter the details of the new user.
Access WildFly Administration Console
To access the WildFly Administration Console from the command line you can use the
Navigate to the WildFly’s bin directory and run the script with the
cd /opt/wildfly/bin/ ./jboss-cli.sh --connect
You will be asked to enter your administrative username and passwor.ز
Once you login the console prompt will change to
[[email protected]:9990 /]. Type
help to get a list of commands and command syntax.
If you prefer to manage your server from the GUI, WildFly also provides a web-based console.
By default, the WildFly administration console is available only from localhost at
If you want to access the console from remote locations you’ll need to make small modifications to the
1 – Open the
wildfly.conf and append
WILDFLY_CONSOLE_BIND=0.0.0.0 at the end of the file.
2 – Open the
launch.sh and edit the highlighted lines:
Restart the service for changes to take effect:
systemctl restart wildfly
3 – Open the
wildfly.service and edit the
ExecStart= line as following:
ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND $WILDFLY_CONSOLE_BIND
4 – Create the
/var/run/wildfly directory and set correct permissions:
mkdir /var/run/wildfly/ chown wildfly: /var/run/wildfly/
5 – Notify systemd that the unit file was changed and restart the service:
systemctl daemon-reload systemctl restart wildfly
6 – Open the WildFly management port in the firewall:
firewall-cmd --zone=public --permanent --add-port=9990/tcp firewall-cmd --reload
Now, you should be able to access the WildFly administration console at