Community Blog How to Install WildFly (JBoss) on Ubuntu 18.04

How to Install WildFly (JBoss) on Ubuntu 18.04

WildFly is a free, open source and a cross-platform application written in Java and developed by Red Hat.

By Hitesh Jethva, Alibaba Cloud Community Blog Author.

WildFly is a free, open source and a cross-platform application written in Java and developed by Red Hat. It is simple, lightweight, flexible and based on the pluggable subsystems. It is specially designed to provide users with a fast and stable Java runtime environment. WildFly provides a simple and powerful web interface to manage single or multiple domains efficiently.

In this tutorial, we will explain how to install WildFly on Ubuntu 18.04 server.


  • A fresh Alibaba Cloud instance with Ubuntu 18.04 desktop installed.
  • A root password is set up to your instance.

Launch Alibaba Cloud ECS Instance

Create a new ECS instance, choosing Ubuntu 18.04 as the operating system with at least 4GB RAM, and connect to your instance as the root user.

Once you are logged into your Ubuntu 18.04 desktop instance, run the following command to update your base system with the latest available packages.

apt-get update -y

When you have an account available, log in as your non-root user to begin.

Install Java

WildFly requires Java version 8 to be installed on your server. By default, Java 8 is not available in the Ubuntu 18.04 default repository. So, you will need to download it from their official website.

After downloading Java 8, extract it to the /usr/lib/jvm directory:

mkdir /usr/lib/jvm/
tar -zxvf jdk-8u221-linux-x64.tar.gz -C /usr/lib/jvm/

Next, set the Java default version with the following command:

update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_221/bin/java 1

Next, verify the Java with the following command:

java -version


java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

Install WildFly

Before installing WildFly, you will need to create a user and group for WildFly. You can create it with the following command:

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

Next, download the latest version of WildFly with the following command:

wget https://download.jboss.org/wildfly/17.0.1.Final/wildfly-17.0.1.Final.zip

Once downloaded, unzip the downloaded file and move it to the /opt/wildfly directory with the following command:

unzip wildfly-17.0.1.Final.zip
mv wildfly-17.0.1.Final /opt/wildfly

Next, give proper permission to the wildfly directory with the following command:

chown -RH wildfly: /opt/wildfly

Configure Systemd File for WildFly

Next, you will need to copy necessary file to configure WildFly.

First, copy WildFly configuration file to /etc/directory:

mkdir -p /etc/wildfly
cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/

Next, WildFly launch.sh file to /opt/wildfly/bin/ directory:

cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/
sh -c 'chmod +x /opt/wildfly/bin/*.sh'

Next, copy WildFly systemd file with the following command:

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

Next, reload the configuration file with the following command:

systemctl daemon-reload

Next, start the WildFly service and enable it to start on boot time with the following command:

systemctl start wildfly
systemctl enable wildfly

You can now check the status of WildFly with the following command;

systemctl status wildfly


● wildfly.service - The WildFly Application Server
   Loaded: loaded (/etc/systemd/system/wildfly.service; disabled; vendor preset: enabled)
   Active: active (running) since Sat 2019-08-03 09:10:00 UTC; 7s ago
 Main PID: 15938 (launch.sh)
    Tasks: 52 (limit: 1098)
   CGroup: /system.slice/wildfly.service
           ├─15938 /bin/bash /opt/wildfly/bin/launch.sh standalone standalone.xml
           ├─15943 /bin/sh /opt/wildfly/bin/standalone.sh -c standalone.xml -b
           └─16003 java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true

Aug 03 09:10:00 hitesh systemd[1]: Started The WildFly Application Server.

Configure WildFly Authentication

Next, you will need to create an admin user to access the WildFly admin console. You can add it with the following command:


You should see the following output:

What type of user do you wish to add? 
 a) Management User (mgmt-users.properties) 
 b) Application User (application-users.properties)
(a): a

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : letscloud
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
 - The password should be different from the username
 - The password should not be one of the following restricted values {root, admin, administrator}
 - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password : 
Re-enter Password : 
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: 
About to add user 'letscloud' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'letscloud' to file '/opt/wildfly/standalone/configuration/mgmt-users.properties'
Added user 'letscloud' to file '/opt/wildfly/domain/configuration/mgmt-users.properties'
Added user 'letscloud' with groups  to file '/opt/wildfly/standalone/configuration/mgmt-groups.properties'
Added user 'letscloud' with groups  to file '/opt/wildfly/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process? 
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? yes
To represent the user add the following to the server-identities definition <secret value="YWRtaW5AMTIz" />

Configure WildFly to Access From Remote Location

By default, WildFly is accessible only from localhost. So you will need to configure WildFly to access from the remote location. You can do it by editing /etc/wildfly/wildfly.conf file:

nano /etc/wildfly/wildfly.conf

Add the following line:


Save and close the file. Then, open /opt/wildfly/bin/launch.sh file:

nano /opt/wildfly/bin/launch.sh

Change the file as shown below:

if [ "x$WILDFLY_HOME" = "x" ]; then

if [[ "$1" == "domain" ]]; then
    $WILDFLY_HOME/bin/domain.sh -c $2 -b $3 -bmanagement $4
    $WILDFLY_HOME/bin/standalone.sh -c $2 -b $3 -bmanagement $4

Save and close the file. The, open /etc/systemd/system/wildfly.service file:

nano /etc/systemd/system/wildfly.service

Make the following changes:

Description=The WildFly Application Server
After=syslog.target network.target



Save and close the file.

Next, Create the /var/run/wildfly directory and set correct permissions:

mkdir /var/run/wildfly/
chown wildfly:wildfly /var/run/wildfly/

Finally, reload the systemd daemon and restart the service for changes to take effect:

systemctl daemon-reload
systemctl restart wildfly

Access WidFly Web Console

Now, open your web browser and type the URL http://your-server-ip:9990/console. You will be redirected to the following page:

Provide your username and password. Then, click on the Sign IN button. You should see the WildFly default dashboard in the following page:



Congratulation! Now we have WidFly installed and a ready-to-use. More information visit: https://wildfly.org/

Thank you to Gary Stevens, CTO at Hosting Canada, for his input into this guide.

0 0 0
Share on


35 posts | 4 followers

You may also like