How to Install the Latest WildFly on Ubuntu 20.04

Introduction

WildFly (formerly known as JBoss) is an application server written in Java and developed by Red Hat. It is an open source application server for JEE applications, it is fast and lightweight and particularly efficient for web and business applications.

The technology behind WildFly is also available in JBoss Enterprise Application Platform 7.

JBoss EAP is a hardened enterprise subscription with Red Hat’s world-class support, long multi-year maintenance cycles, and exclusive content.

In this guide, we will show you how to install the latest WildFly on Ubuntu 20.04.

Also you can install wildfly on CentOS by visiting the link: How to install and configure Wildfly on CentOS 8

Wildfly Installation

Just follow the steps below to get start with Wildfly:

  • Update your Ubuntu system
sudo apt update && sudo apt upgrade
  • Wildfly is software written in Java, so we need to install java environment.
sudo apt install default-jdk
  • Create a user and group for Wildfly on the /opt/wildfy directory on our system.
sudo groupadd -r wildfly
sudo useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly
  • Download and Install Wildfly
cd /tmp
wget https://github.com/wildfly/wildfly/releases/download/26.0.0.Final/wildfly-26.0.0.Final.tar.gz

At the time of this writing, the latest version of Wildfly is 26.0.0 , To download the latest version, kindly visit the official website by pressing the button below. 

  • Extract the downloaded archive file.
 tar xvf wildfly-26.0.0.Final.tar.gz
  • Move the wildfly extracted directory to the /opt directory
sudo mv wildfly-26.0.0.Final/ /opt/wildfly
  • Change the permissions to the user and group wildfly.
sudo chown -RH wildfly: /opt/wildfly
  • Then create a WildFly directory that will store the configuration files in the /etc
sudo mkdir -p /etc/wildfly
  • Copy the Wildfly configuration file to /etc/wildfly
sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/
  • Copy the launch.sh file to the /opt/wildfly/bin/
sudo cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/
  • Make the scripts in that directory executable
sudo sh -c 'chmod +x /opt/wildfly/bi n/*.sh'
  • So copy Wildfly systemd file to the /etc/systemd/system/ directory to check, start and enable it as a service.
sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system
  • Start and enable the Wildfly service
sudo systemctl start wildfly.service
sudo systemctl enable wildfly.service
  • Also verify if Wildfly is up and running or not by checking its service status.
sudo systemctl status wildfly.service
  • So, We need to create an admin user account to manage the web console, we will do that by running add-user script as follows.
sudo /opt/wildfly/bin/add-user.sh
  • As shown above, Type a and hit enter to continue then create username and password, Also Type yes for the rest of the options.
  • Finally, Open your browser then go to http://Server_IP:8080
  • By default, the server console can only be accessed on localhost. To allow remote connections, edit the configuration file of wildfly.
sudo vim /etc/wildfly/wildfly.conf
  • Then append the line below to the file.
WILDFLY_CONSOLE_BIND=0.0.0.0
  • Also, run the below script to create an account to login to the server console.
sudo sh /opt/wildfly/bin/jboss-cli.sh --connect

You need to provide the username and password you created above.

  • Open the launch script.
sudo vim /opt/wildfly/bin/launch.sh
  • And append the lines shown below in the launch script as shown below in the screenshot.
$WILDFLY_HOME/bin/domain.sh -c $2 -b $3 -bmanagement $4
$WILDFLY_HOME/bin/standalone.sh -c $2 -b $3 -bmanagement $4
  • Open the systemd unit file of wildfly.
sudo vim /etc/systemd/system/wildfly.service
  • Append the line below to the file.
ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND $WILDFLY_CONSOLE_BIND
  • Restart the systemd and the Wildfly service
sudo systemctl daemon-reload
sudo systemctl restart wildfly.service
  • Now you can access the admin console by clicking on Administration Console in the main wildfly page OR you can just go to the address http://IP_address:9900
  • Sign in with the credentials you created before.
  • You will be directed to the following dashboard.

Conclusion

That’s it..

In this guide, we illustrated how to download and install wildfly in Ubuntu 20.04.

Also read ……… How to install and configure Wildfly on CentOS 8

Thanks.

Qadry
unixcop Admin

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

You might also likeRELATED

How to set PassivePortRange and PassiveIP in pure-ftpd on Ubuntu to secure the app!

Introduction Hi guys, We will talk about setting PassivePortRange and PassiveIP in pure-ftpd. If you run a firewall on your Linux server and want to...

Install Java 8 on CentOS 8

Hi Guys, In this guide, we’ll show you how to install Oracle’s Java 8 programming language on CentOS 8 . It's an object-oriented language...

How to install flameshot on RHEL/CentOS using Snapcraft

In this post, you will learn how to install Flameshot on RHEL / CentOS Flameshot is a powerful open source screenshot and annotation tool for...