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
- Step 1: Update Your System
- Step 2: Installing Default OpenJDK 11
- Step 3: Downloading the WildFly on Ubuntu 24.04
- Step 4: Extracting the WildFly Tar File
- Step 5: Creating WildFly User and Changing its Ownership
- Step 6: Configuring the WildFly on Ubuntu 24.04
- Step 7: Make the WildFly Script Executable
- Step 8: Start and Enable the WildFly Service
- Step 9: Create and Configure WildFly Management Console
- Step 10: Accessing the WildFly Admin Panel
- How to Uninstall WildFly from Ubuntu 24.04
- Conclusion
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
To check what Java version is installed, run this:
java --version
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:
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
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.
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
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
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
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
The next step is to give permissions to the directory where we have copied the WildFly files:
sudo chown -RH wildfly:wildfly /opt/wildfly
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
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.
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
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
Now reload the system daemon, so the changes made to the systemctl service get applied:
sudo systemctl daemon-reload
To confirm if WildFly is enabled, you can check its status using the following systemctl command:
systemctl status wildfly
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:
- 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.
- 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
Inside this file, replace the 0.0.0.0 with 127.0.0.1:
WILDFLY_BIND= 127.0.0.1
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
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
Once the page loads, find the section labeled Administrator Console, and click on it.
To open the Hal Management interface, the login credential needs to be entered.
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
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.
Check our LinkedIn company page