UbuntuUbuntu Based

How To Install WildFly on Ubuntu 22.04 LTS

Install WildFly on Ubuntu 22.04

In this tutorial, we will show you how to install WildFly on Ubuntu 22.04 LTS. For those of you who didn’t know, WildFly is a powerful, modular, and lightweight application server that helps you build amazing applications. It is cross-platform and comes with a sophisticated interface that makes changing application server settings and configuration very simple and quick. As of this writing, WildFly 26 is the latest release in a series of JBoss opensource application server offerings

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the WildFly (JBoss) on Ubuntu 22.04 (Jammy Jellyfish). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.

Prerequisites

  • A server running one of the following operating systems: Ubuntu 22.04, 20.04, and any other Debian-based distribution like Linux Mint.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install WildFly on Ubuntu 22.04 LTS Jammy Jellyfish

Step 1. First, make sure that all your system packages are up-to-date by running the following apt commands in the terminal.

sudo apt update
sudo apt upgrade
sudo apt install wget apt-transport-https gnupg2 software-properties-common

Step 2. Installing Java.

WildFly requires a Java Standard Edition Runtime Environment (JRE) version 11 or later. Now run the following command to install OpenJDK:

sudo apt install default-jdk

Verify the installation:

java -version

Step 3. Installing WildFly on Ubuntu 22.04.

By default, WildFly is available on Ubuntu 22.04 base repository. Now run the following command below to download the latest stable version of WildFly to your Ubuntu system:

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

Next, extract the downloaded file:

tar -xf wildfly-26.1.1.Final.tar.gz

Move to /opt directory, so that we don’t accidentally delete it:

sudo mv wildfly-26.1.1.Fina /opt/wildlfy

Now change the directory permissions to the user and group WildFly:

sudo chown -RH wildfly:wildfly /opt/wildfly

Step 4. Add WildFly Users.

Create a user and group for WildFly:

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

Step 5. Create WildFly Management Console and Application User.

We run a script to either configure the existing “admin” user or create a new one. Just execute the given command below:

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

Step 6. Configure WildFly.

Now we create a WildFly directory which will store the configuration files in the /etc/ directory:

sudo mkdir -p /etc/wildfly

Copy WildFly systemd service, configuration file, and start scripts templates from the /opt/wildfly/docs/contrib/scripts/systemd/ directory:

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

Then, make the scripts in the /opt/wildfly directory executable:

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

Now start and enable the Wildfly service on your Ubuntu system:

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

Step 7. Configure WildFly Admin Console.

By default, you won’t be able to access the Admin interface. Now run a script to configure the existing “administrator” user or create a new one:

sudo nano /etc/wildfly/wildfly.conf

Replace 0.0.0.0 with 127.0.0.1 in the following line:

WILDFLY_BIND= 127.0.0.1

Step 8. Configure the Firewall.

If your server is protected by a firewall and you want to access the WildFly interface from the outside of your local network you need to open ports 8080and 9990:

sudo ufw allow 8080/tcp
sudo ufw allow 9990/tcp

Step 9. Accessing WildFly Web Interface.

Once successfully installed, open your web browser and access the WildFly using the URL https://your-IP-address:8080. You will be redirected to the WildFly page:

Install WildFly on Ubuntu 22.04 LTS Jammy Jellyfish

To access the Wildfly admin console type the URL http://your-IP-address:9990/console in your web browser. You will be asked to provide an admin username and password as below:

Install WildFly on Ubuntu 22.04 LTS Jammy Jellyfish

Congratulations! You have successfully installed WildFly. Thanks for using this tutorial for installing the WildFly (JBoss) on Ubuntu 22.04 LTS Jammy Jellyfish system. For additional help or useful information, we recommend you check the official WildFly website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button