How To Install WildFly on Rocky Linux 9
In this tutorial, we will show you how to install WildFly on Rocky Linux 9. For those of you who didn’t know, WildFly is a flexible, lightweight, and open-source application server that is written in Java. It is also known as JBoss AS or JBoss EAP, which was initially developed by JBoss Community and is now being maintained by Red Hat. WildFly is used to build and deploy Java-based applications such as websites, web applications, and enterprise applications.
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 on Rocky Linux. 9.
Prerequisites
- A server running one of the following operating systems: Rocky Linux 9.
- 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).
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for WildFly.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install WildFly on Rocky Linux 9
Step 1. The first step is to update your system to the latest version of the package list. To do so, run the following commands:
sudo dnf check-update sudo dnf update
Step 2. Installing Java.
WildFly requires Java to be installed on the system. We will install OpenJDK 11, which is available in the default Rocky Linux 9 repositories. To install Java, run the following command:
sudo dnf install java-11-openjdk-devel
Verify the Java version:
java -version
Step 3. Installing WildFly on Rocky Linux 9.
By default, WildFly is not available on the Rocky Linux 9 base repository. Now we download the latest version of WildFly from the official page:
wget https://github.com/wildfly/wildfly/releases/download/27.0.1.Final/wildfly-27.0.1.Final.zip
Next, extract the downloaded file using the following command:
sudo tar -xvf wildfly-27.0.1.Final.zip
Step 4. Create a WildFly User.
Run the following command to create a new system user for WildFly:
sudo useradd -r -s /sbin/nologin wildfly
Set the permissions of the extracted WildFly directory using the following command:
sudo chown -R wildfly:wildfly /opt/wildfly-27.0.1.Final/
Step 5. Create a Systemd Service file for WildFly.
Run the following command to create a new systemd
service file:
nano /etc/systemd/system/wildfly.service
Add the following file:
[Unit] Description=WildFly application server After=syslog.target network.target [Service] Type=simple User=wildfly Group=wildfly ExecStart=/opt/wildfly/bin/standalone.sh -b=0.0.0.0 ExecStop=/opt/wildfly/bin/jboss-cli.sh --connect command=:shutdown TimeoutStartSec=300 TimeoutStopSec=300 Restart=always RestartSec=10 [Install] WantedBy=multi-user.target
Save and close the file, then start the WildFly service using the following command:
sudo systemctl enable wildfly sudo systemctl start wildfly
To check if the service has started successfully, use the following command:
sudo systemctl status wildfly
Step 6. Configure Firewall.
Now allow the WildFly Administration Console port through the firewall:
sudo firewall-cmd --permanent --add-port=9990/tcp sudo firewall-cmd --reload
Step 7. Accessing WildFly Web Interface.
Once successfully installed, open your web browser and access WildFly using the URL http://your-IP-address:9990
. You will be redirected to the following page:
The default username and password are both admin
.
Congratulations! You have successfully installed WildFly. Thanks for using this tutorial for installing the WildFly on your Rocky Linux 9 system. For additional help or useful information, we recommend you check the official WildFly website.