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.


To follow this guide, you'll need a fresh installed Ubuntu 18.04 server, a regular, non-root user with sudo permission, enable a basic firewall to block non-essential ports and 2GB of memory.

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

Step 1 - Update The System

First, it is recommended to update your system packages to the latest version. You can update them using the following command:


sudo apt-get update -y sudo apt-get upgrade -y

Once all the packages are updated, restart your system to apply all the configuration changes.

Step 2 - 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:


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

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


sudo 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)

Step 3 - Install WildFly

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


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

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



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


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

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


sudo chown -RH wildfly: /opt/wildfly

Step 4 - Configure Systemd File for WildFly

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

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


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

Next, WildFly file to /opt/wildfly/bin/ directory:


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

Next, copy WildFly systemd file with the following command:


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

Next, reload the configuration file with the following command:


sudo systemctl daemon-reload

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


sudo systemctl start wildfly sudo systemctl enable wildfly

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


sudo 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 ( Tasks: 52 (limit: 1098) CGroup: /system.slice/wildfly.service ├─15938 /bin/bash /opt/wildfly/bin/ standalone standalone.xml ├─15943 /bin/sh /opt/wildfly/bin/ -c standalone.xml -b └─16003 java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m

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

Step 5 - 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:


sudo /opt/wildfly/bin/

You should see the following output:


What type of user do you wish to add? a) Management User ( b) Application User ( (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 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/' Added user 'letscloud' to file '/opt/wildfly/domain/configuration/' Added user 'letscloud' with groups to file '/opt/wildfly/standalone/configuration/' Added user 'letscloud' with groups to file '/opt/wildfly/domain/configuration/' 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

Step 6 - 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:


sudo nano /etc/wildfly/wildfly.conf

Add the following line:



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


sudo nano /opt/wildfly/bin/

Change the file as shown below:


if [ "x$WILDFLY_HOME" = "x" ]; then WILDFLY_HOME="/opt/wildfly" fi

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

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


sudo nano /etc/systemd/system/wildfly.service

Make the following changes:


[Unit] Description=The WildFly Application Server Before=httpd.service

[Service] Environment=LAUNCH_JBOSS_IN_BACKGROUND=1 EnvironmentFile=-/etc/wildfly/wildfly.conf User=wildfly LimitNOFILE=102642 PIDFile=/var/run/wildfly/ ExecStart=/opt/wildfly/bin/ $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND $WILDFLY_CONSOLE_BIND StandardOutput=null


Save and close the file.

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


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

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


sudo systemctl daemon-reload sudo systemctl restart wildfly

Step 7 - 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: wildfly-web-console

Provide your username and password. Then, click on the Ok button. You should see the WildFly default dashboard in the following page: wildfly-web-console-dashboard


Congratulation! Now we have WidFly installed and a ready-to-use.

More information visit:

Read more about: Operating SystemUbuntu