How to Install WildFly Application Server on Ubuntu 24.04

WildFly is a free alternative to the popular JBoss application server. It is built by the Red Hat community. While it shares JBoss’s roots, WildFly is a distinct project with its own development path. WildFly is written in Java, and it is a platform that is specifically designed for running Java programs that involve web services and communication. These functionalities aren’t included in the standard Java software development kit.

In this guide, we’ll walk you through setting up WildFly on your Ubuntu 24.04 server. We’ll be installing it manually using the binary package available for Ubuntu.

Table of Contents:

How to Install WildFly Application Server on Ubuntu 24.04

To install WildFly on Ubuntu u24.04 make sure your system is up-to-date and Java is installed on your system. After that, you need to download the Tar file for WildFly. Once the binary files are downloaded, extract it and install it on your system.

Let’s follow each of these steps in detail.

Step 1: Update Your System

Before proceeding with the WildFly installation, update your outdated system packages:

sudo apt update

Step 2: Installing Default OpenJDK 11

WildFly is written in Java, and its functionalities depend on Java classes and libraries. OpenJDK is required to interpret and execute Java byte code. It helps WildFly to run on your Ubuntu system.

To install OpenJDK, run this command:

sudo apt install default-jdk
WildFly Application Server on Ubuntu 24.04 a

To check what Java version is installed, run this:

java --version
WildFly Application Server on Ubuntu 24.04 b

Once the Java is installed, let’s proceed towards the WildFly binary package downloading.

Step 3: Downloading the WildFly on Ubuntu 24.04

Like most open-source packages, WildFly is also unavailable in the default Ubuntu 24.04 repository. To get its latest binary file, navigate to the WildFly download page.

Here, click the TGZ file to download it:

WildFly Application Server on Ubuntu 24.04 c

Alternatively, the wget command can also give you the Tar file of the WildFly binary package. To get it run this:

wget https://github.com/wildfly/wildfly/releases/download/32.0.0.Final/wildfly-32.0.0.Final.tar.gz
WildFly Application Server on Ubuntu 24.04 d

Just make sure you replace the updated URL in the above command. To get the latest URL, open the WildFly download page, right-click the highlighted Tar file above, and select Copy Link Address. Paste that link in the above command.

WildFly Application Server on Ubuntu 24.04 e

Step 4: Extracting the WildFly Tar File

After downloading the Tar file for WildFly, the next step is to extract it. For that, run this command:

tar -xf wildfly-32.0.0.Final.tar.gz
WildFly Application Server on Ubuntu 24.04 f

The WildFly directory will be created, now move this directory to /opt so it doesn’t get deleted accidentally.

To move the extracted file, run the mv command by specifying the file name and path where this file will be moved:

sudo mv wildfly-32.0.0.Final /opt/wildfly
WildFly Application Server on Ubuntu 24.04 g

Step 5: Creating WildFly User and Changing its Ownership

The Next step is to create a group for WildFly users. This allows the non-root user to use WildFly without sudo permissions.

First, create a new group name WildFly using this command:

sudo groupadd -r wildfly
WildFly Application Server on Ubuntu 24.04 h

The -r flag tells the system to create the group with a system account.

Alternatively, if there’s an existing group on the system that WildFly can use, you can skip this step and assign the user to that group during creation.

Now we have to add the user to the above-created group. Here, I am going to create a new user named WildFly using this command:

sudo useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly
WildFly Application Server on Ubuntu 24.04 i

The next step is to give permissions to the directory where we have copied the WildFly files:

sudo chown -RH wildfly:wildfly /opt/wildfly
WildFly Application Server on Ubuntu 24.04 j

Step 6: Configuring the WildFly on Ubuntu 24.04

Now we will configure WildFly as a systemd service on Ubuntu 24.04 system. First, create the WildFly directory inside the/etc directory:

sudo mkdir -p /etc/wildfly
WildFly Application Server on Ubuntu 24.04 k

This directory will be used to store WildFly configuration files specific to systemd.

Now copy the systemd service configuration files for WildFly to the newly created directory:

sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/

Similarly, copy the file wildfly.service from the same location as the previous command to the systemd service unit directory. This file defines how WildFly will be started, stopped, and managed by systemd:

sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/

Finally, copy the script launch.sh from the same location to the WildFly bin director. This script is used to launch WildFly with the proper configuration based on systemd settings.

sudo cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/

Above, all three commands copy the necessary configuration files to manage WildFly as a systemd service on an Ubuntu 24.04 system.

WildFly Application Server on Ubuntu 24.04 l

Step 7: Make the WildFly Script Executable

The Next step is to make the WildFly script executable, this allows us to run the script files:

sudo chmod +x /opt/wildfly/bin/*.sh
WildFly Application Server on Ubuntu 24.04 m

By making these scripts executable, you allow them to be run from the command line. This is necessary for managing the WildFly application server. These scripts are used to start, stop, or configure the server. Some main scripts inside this directory include the add-user, app client, domain, jboss, jconsole scripts, and some other required scripts.

Step 8: Start and Enable the WildFly Service

Now that the WildFly is installed, the next step is to start and enable the WildFly service using the systemctl command. This will result in the auto start of the WildFly services on system boot.

To allow the WildFly service, run this command:

sudo systemctl enable --now wildfly
WildFly Application Server on Ubuntu 24.04 n

Now reload the system daemon, so the changes made to the systemctl service get applied:

sudo systemctl daemon-reload
WildFly Application Server on Ubuntu 24.04 o

To confirm if WildFly is enabled, you can check its status using the following systemctl command:

systemctl status wildfly
WildFly Application Server on Ubuntu 24.04 p

Similarly, you can also restart the WildFly services using this command:

sudo systemctl restart wildfly

In case you temporarily want to disable the WildFly services on your Ubuntu 24.04 system, then run this command:

sudo systemctl stop wildfly

Step 9: Create and Configure WildFly Management Console

The Next step is to set up the user for the WildFly management console. For this, you have to run this script to create a new user or use the existing Admin user:

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

This script interacts with WildFly’s user configuration files to perform one of two actions:

  1. Configure existing admin user: If an admin user already exists in WildFly’s configuration, the script will prompt you to update their password or other access settings.
  2. Create a new user: The script will guide you through creating a new user for WildFly and specifying its username and password. This will assign them roles within the application server.

Now as the user is set, you still can’t access the management console and admin panel, however, if you try to do so the error will pop up on your screen.

To remove the above error and log in to the WildFly management console, you have to edit the WildFly configuration file:

sudo nano /etc/wildfly/wildfly.conf
WildFly Application Server on Ubuntu 24.04 q

Inside this file, replace the 0.0.0.0 with 127.0.0.1:

WILDFLY_BIND= 127.0.0.1
r

Finally, restart the WildFly service using this command:

sudo systemctl restart wildfly

Before you proceed to access the WildFly management console, the last step you need to do is to allow WildFly service through any firewall you are using:

Run these two commands to allow the WildFly service through firewall ports:

sudo ufw allow 8080/tcpsudo ufw allow 9090/tcp
s

Step 10: Accessing the WildFly Admin Panel

To access the WildFly admin panel, open your web browser on the device where you installed the application server. In the address bar of your browser, type below address:

http://127.0.0.1:8080
WildFly Application Server on Ubuntu 24.04 t

Once the page loads, find the section labeled Administrator Console, and click on it.

WildFly Application Server on Ubuntu 24.04 u

To open the Hal Management interface, the login credential needs to be entered.

WildFly Application Server on Ubuntu 24.04 v

Allow WildFly Remote Access

To allow remote access to WildFly, you have to edit its configuration file:

sudo nano /opt/wildfly/standalone/configuration/standalone.xml

Scroll down to the end and find the part labeled Interfaces. Change the IP address in the management and public sections from 127.0.0.1 (localhost) to 0.0.0.0. This allows any machine that can reach your server’s IP to access the WildFly web interface remotely.

<interfaces>
<interface name="management">
        <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
</interface>
<interface name="public">
        <inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>
</interfaces>

Press Ctrl+O to save, then Enter to confirm the filename. Finally, press Ctrl+X to exit the editor.

Note: To avoid security risk, you can also only specify trusted machines to access the Management Console. To do this, you have to edit the public interface section again. Replace 0.0.0.0 with the IP address of the authorized machine.

Now open the front-end configuration file:

sudo nano /etc/wildfly/wildfly.conf

Here also locate the address entry and modify it to 0.0.0.0:

Now save the file and restart your WildFly service again:

sudo systemctl restart wildfly

Remote access for WildFly is enabled.

How to Uninstall WildFly from Ubuntu 24.04

To uninstall WildFly from your system, you simply have to remove the WildFly-related directories and files.

First, delete the main WildFly application files using this command:

sudo rm -r /opt/wildfly

Now remove the WildFly configuration directory using this command:

sudo rm -r /etc/wildfly

Lastly, remove the WildFly systemd service file. This removes the service file that manages to start and stop WildFly:

sudo rm -r /etc/systemd/system/wildfly.service
WildFly Application Server on Ubuntu 24.04 w

Conclusion

WildFly is a free alternative to the popular JBoss application server. To install WildFly on your Ubuntu 24.04 system first make sure the Java is available on your system. After that, download the TGZ file for WildFly from their official site. Once downloaded, extract this file and set up the WildFly user. Lastly, you have to configure the firewall port and address for accessing the WildFly. You can set up a local host or define a public IP address to access it remotely. Check the detailed installation steps for WildFly in this article.

Over 500 Million Views on Our Blogs and YouTube! We’re inviting 10 businesses to partner with us and grow together. Click here to join us! ×