Site icon CentLinux

How to install WildFly on RHEL 8

Share on Social Media

Learn how to install WildFly on RHEL 8 with our step-by-step guide. Set up this powerful Java application server easily and efficiently on your Red Hat Enterprise Linux 8 system. #centlinux #linux #wildfly

What is JBoss WildFly?

JBoss WildFly, commonly referred to as just WildFly, is an open-source application server developed by Red Hat. It is designed to deploy and manage Java-based web applications and enterprise applications. Here are some key features and aspects of WildFly:

Overall, WildFly is known for its flexibility, performance, and adherence to Java EE standards, making it a popular choice for developers and organizations building Java-based applications.

How to install WildFly on CentOS 8

WildFly vs Tomcat

WildFly and Apache Tomcat are both popular Java-based application servers, but they serve different purposes and cater to different needs. Here’s a comparison to highlight their key differences:

Purpose and Scope

WildFly:

Tomcat:

Features

WildFly:

Tomcat:

Performance

WildFly:

Tomcat:

Use Cases

WildFly:

Tomcat:

Community and Support

WildFly:

Tomcat:

Summary

Recommended Training: Java Masterclass 2025: 130+ Hours of Expert Lessons from Tim Buchalka

Environment Specification

We are using a minimal Red Hat Enterprise Linux 8 virtual machine with following specifications.

Read Also: How to install WildFly on CentOS 7

Update your Linux Operating System

Connect with wildfly-01.centlinux.com as root user by using a ssh client.

Build cache for enabled yum repositories on your Linux server.

dnf makecache

Execute following command to update your Linux operating system.

dnf update -y

If the above command updates your Linux Kernel then reboot your Linux server with the newly installed Kernel.

reboot

After reboot, verify the version of Linux Kernel and Linux operating system.

uname -r
cat /etc/redhat-release

Output:

4.18.0-348.7.1.el8_5.x86_64
Red Hat Enterprise Linux release 8.5 (Ootpa)

Install WildFly Prerequisites

JBoss WildFly is written in Java programming language. Therefore, it requires Java Runtime Environment for execution.

You can easily install OpenJDK, that is available through standard yum repositories.

dnf install -y java-11-openjdk-devel

After installation, verify that the java command is available by querying its version as follows.

java --version

Output:

openjdk 11.0.13 2021-10-19 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.13+8-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8-LTS, mixed mode, sharing)

You may also need wget command to download WildFly installation file. Therefore, install it now by using dnf command.

dnf install -y wget

Create Linux User and Group

Create a Linux user and group to own WildFly software and processes.

groupadd -r wildfly
useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly

Install WildFly on RHEL 8

WildFly is a free and open source software. Therefore, you can download latest WildFly software from their official website.

WildFly Downloads

Copy the URL of your required version of WildFly software and use it with wget command to download WildFly straight from the Linux CLI.

wget https://github.com/wildfly/wildfly/releases/download/26.0.0.Final/wildfly-26.0.0.Final.tar.gz

We have down TGZ file, howerver you can also download ZIP file of WildFly software.

Execute following tar command to extract WildFly TGZ file to the desired location.

tar xf wildfly-26.0.0.Final.tar.gz -C /opt/

Create a soft link of WildFly software directory for convenience.

ln -s /opt/wildfly-26.0.0.Final/ /opt/wildfly

Adjust ownership of extracted files as follows.

chown -RH wildfly: /opt/wildfly

Create a directory for WildFly configuration files.

mkdir -p /etc/wildfly

Configure WildFly Server

WildFly software directory contains sample configuration files. You can use these configuration files to configure a Systemd service for your JBoss WildFly server.

cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/
cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/
cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/

Grant execution privileges on WildFly scripts.

chmod +x /opt/wildfly/bin/*.sh

Enable and start WildFly service.

systemctl daemon-reload
systemctl enable --now wildfly.service

Configure Linux Firewall

WildFly default service port is 8080/tcp and the Management Console uses 9990/tcp.

Therefore, you are required to allow these service ports in Linux Firewall to make the WildFly services accessible across the network.

firewall-cmd --permanent --add-port={8080,9990}/tcp
firewall-cmd --reload

Configure WildFly Web Management Console

WildFly management console does not has a default user. Therefore, you must create an Admin user for using WildFly management console.

You can execute add-user.sh script to create a user for WildFly management console.

/opt/wildfly/bin/add-user.sh

Output:

What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a):

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : centlinux
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
- The password should be different from the username
- The password should not be one of the following restricted values {root, admin, administrator}
- The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password :
Re-enter Password :
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]:
About to add user 'centlinux' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'centlinux' to file '/opt/wildfly-26.0.0.Final/standalone/configuration/mgmt-users.properties'
Added user 'centlinux' to file '/opt/wildfly-26.0.0.Final/domain/configuration/mgmt-users.properties'
Added user 'centlinux' with groups to file '/opt/wildfly-26.0.0.Final/standalone/configuration/mgmt-groups.properties'
Added user 'centlinux' with groups to file '/opt/wildfly-26.0.0.Final/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server Jakarta Enterprise Beans calls.
yes/no? yes
To represent the user add the following to the server-identities definition <secret value="QWhtZXJAMTIzNA==" />

WildFly management console is by default configured on localhost (127.0.0.1) interface. Therefore, it is not accessible across the network.

You need to edit following configuration file to configure WildFly management console interface.

Use vim text editor to edit standalone.xml file.

vi /opt/wildfly/standalone/configuration/standalone.xml

Locate following line in this file.

<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>

Remove interface=”management” then save and exit from vim text editor.

<socket-binding name="management-http" port="${jboss.management.http.port:9990}"/>

Restart WildFly service to apply changes.

systemctl restart wildfly.service

Open http://wildfly-01.centlinux.com:8080 in a web browser.

WildFly Default Page

Click on “Administration Console” and login as the admin user that you have created in previous steps.

WildFly Web Management Console

After successful login, you have reached at the dashboard of WildFly Management Console.

Frequently Asked Questions (FAQs)

1. Is WildFly the same as JBoss?

WildFly was formerly known as JBoss Application Server (JBoss AS). Red Hat rebranded it as WildFly starting from version 8. It remains an open-source Java EE/Jakarta EE server but with a more modern and lightweight architecture.

2. What are the system requirements for running WildFly?

WildFly requires:

3. How do I deploy an application in WildFly?

Copy your .war or .ear file into the standalone/deployments directory, or use the WildFly CLI (jboss-cli.sh/bat) or the web-based admin console (http://localhost:9990).

4. What is the default port for WildFly?

WildFly uses:

5. How do I configure a datasource in WildFly?

Use the admin console (Configuration → Subsystems → Datasources) or the CLI to add a datasource with your database driver and connection details. Example CLI command:

/subsystem=datasources/data-source=MyDS:add(driver-name=h2,connection-url="jdbc:h2:mem:test",user=sa,password=sa)  

Final Thoughts

Installing WildFly on RHEL 8 can significantly enhance your ability to deploy and manage Java-based applications efficiently. With the right steps and guidance, the process can be straightforward and rewarding. If you need personalized assistance or a detailed guide tailored to your specific needs, I offer professional services to help you get WildFly up and running smoothly.

Need expert AWS and Linux system administration? From cloud architecture to server optimization, I provide reliable and efficient solutions tailored to your needs. Hire me on Fiverr today!

Exit mobile version