34.6 C

How To Install WildFly (JBoss) on Ubuntu 18.04

This manual will stroll you through the set up to Install WildFly (JBoss) server on Ubuntu 18.04 / Debian 10/9. WildFly previously referred to as JBoss is an application server written in java and developed via Red Hat. WildFly utility server is an extremely fast, lightweight and powerful implementation of the java organization edition eight platform specs.
As of this writing, WildFly 18 is the present day release in a sequence of JBoss open-source application server services. This tutorial gives a brief review on how to download and install WildFly 18 on Ubuntu 18.04 / Debian 10/9 for your application development.

Step 1: Install Java

To install WildFly, you must have installed Java as it is the basic requirements for WildFly Installation.

There are two ways by which you can Install Java.

  1. Install OpenJDK
  2. Java SE Development Kit

But I Recommend to use OpenJDK as it is the easiest way to Install Java on your Ubuntu / Debian based systems.

- Advertisement -
sudo apt update
sudo apt -y install default-jdk

Keep in mind that you have installed the Java version 10 or later to support the installation of WildFly. Check the Java version by typing java –version command as shown in figure.

Step 2: How To Download WildFly?

Go To the official Download Page of WildFly to download and Install WildFly on your System. In my case I’m downloading the final release 18.0.1. But you can also download the Beta version as it is available now.

export WILDFLY_RELEASE="18.0.1"
wget https://download.jboss.org/wildfly/$WILDFLY_RELEASE.Final/wildfly-$WILDFLY_RELEASE.Final.tar.gz

Then extract the file.

tar xvf wildfly-$WILDFLY_RELEASE.Final.tar.gz

Now, move the resulting directory to the following path

sudo mv wildfly-$WILDFLY_RELEASE.Final/ /opt/wildfly

Step 3: Configure Systemd

First of all, create a specific user for WildFly and the group to easily manage the WildFly Services.

sudo groupadd --system wildfly
sudo useradd -s /sbin/nologin --system -d /opt/wildfly -g wildfly wildfly

After adding user and group, let’s create the configuration file for the purpose of configuration as we already Install WildFly.

sudo mkdir /etc/wildfly

Then copy the WildFly systemd service, config file & start scripts which are located at /opt/wildfly/docs/contrib/scripts/systemd/ directory

Give /opt/wildfly permissions.

sudo chown -R wildfly:wildfly /opt/wildfly

Now, restart systemd services & then start and enable WildFly services.

sudo systemctl daemon-reload
sudo systemctl start wildfly
sudo systemctl enable wildfly

Make sure the status of WildFly is running

sudo systemctl status wildfly

Then bind the service to the port 8080 by running

sabi@Ubuntu:~$  ss -tunelp | grep 8080

Step 4: Adding WildFly Users

As default WildFly 18 is now allotted with security enabled for the management interfaces. We need to create a user who can get admin privileges to WildFly management console or remotely use the CLI. A script is furnished for managing customers.

To do this fire the command

sabi@Ubuntu:~$ sudo /opt/wildfly/bin/add-user.sh

Then choose the Management User option from the listed list as we want admin privileges.

Then press enter & agree to the prompts to finish user creation.

Step 5: Access WildFly Admin Console

From CLI:

Add /opt/wildfly/bin/ to your $PATH to run WildFly scripts from your current shell session. Then source the bashrc file.

It’s time to Connect to the WildFly Console using the jboss-cli.sh –connect command.

From Web:

To access WildFly from Web simply type localhost:9990 as the default port can be accessed as 9990.

sabi@Ubuntu:~$ ss -tunelp | grep 9990

Provide user details you’ve created earlier to proceed further.

Then you will be redirected to the WildFly Dashboard. Here you can perform various tasks like Deployments, Configuration and much more.

That’s it! You have successfully installed WildFly on your Ubuntu system. If you want to access it outside the local server then do the following tasks.

Edit the file /opt/wildfly/bin/launch.sh to look like this

if [[ "$1" == "domain" ]]; then
$WILDFLY_HOME/bin/domain.sh -c $2 -b $3
$WILDFLY_HOME/bin/standalone.sh -c $2 -b $3 -bmanagement=

Where bmanagement= is used to start script line & binds “management” interface to the any IP address.

Then start wildfly services again

sudo systemctl restart wildfly

Re-check the port

ss -tunelp | grep 9990

Step 6: Create a Simple Deployment

Now, you can easily manage the deployments,configuration and much more. You can also upload, retrieve, and create deployments. Let’s create a deployment called as”Sabi”

So, this is how you can Install WildFly on Ubuntu 18.04. For more details go to WildFly Documentation.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
"The best Linux newsletter on the web"


Please enter your comment!
Please enter your name here

Latest article