How to Install WildFly (JBoss) on Ubuntu 18.04

Updated on

7 min read

Install wildfly (JBoss) on Ubuntu 18.04

WildFly , formerly known as JBoss is a cross-platform open-source application runtime written in Java that helps you build amazing applications. WildFly is flexible, lightweight, and it is based on pluggable subsystems that can be added or removed as needed.

This tutorial will show you how to install WildFly application server on Ubuntu 18.04. The same instructions apply for Ubuntu 16.04 and any Ubuntu-based distribution, including Kubuntu, Linux Mint and Elementary OS.


In order to be able to install packages on your Ubuntu system, you must be logged in as a user with sudo privileges .

Step 1: Install Java OpenJDK

WildFly requires Java to be installed. We’ll install OpenJDK , which is the default Java development and runtime in Ubuntu 18.04.

The installation of Java is pretty simple. Start by updating the package index:

sudo apt update

Install the OpenJDK package by running:

sudo apt install default-jdk

Step 2: Create a User

We will create a new system user and group named wildfly with home directory /opt/wildfly that will run the WildFly service:

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

Step 3: Install WildFly

At the time of writing, the latest version of WildFly is 16.0.0. Before continuing with the next step you should check the download page for a new version. If there is a new version replace the WILDFLY_VERSION variable in the command below.

Download the WildFly archive in the /tmp directory using the following wget command:

WILDFLY_VERSION=16.0.0.Finalwget$WILDFLY_VERSION/wildfly-$WILDFLY_VERSION.tar.gz -P /tmp

Once the download is completed, extract the tar.gz file and move it to the /opt directory:

sudo tar xf /tmp/wildfly-$WILDFLY_VERSION.tar.gz -C /opt/

Create a symbolic link wildfly which will point to the WildFly installation directory:

sudo ln -s /opt/wildfly-$WILDFLY_VERSION /opt/wildfly

WildFly will run under the wildfly user which needs to have access to the WildFly installation directory.

The following command will change the directory ownership to user and group wildfly:

sudo chown -RH wildfly: /opt/wildfly

Step 4: Configure Systemd

The WildFly package includes files necessary to run WildFly as a service.

Start by creating a directory which will hold the WildFly configuration file:

sudo mkdir -p /etc/wildfly

Copy the configuration file to the /etc/wildfly directory:

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

This file allows you to specify the WildFly mode and bind address. By default, WildFly will run in a standalone mode and will listen on all interfaces. You can edit the file according to your needs.

# The configuration you want to run

# The mode you want to run

# The address to bind to

Next copy the WildFly script to the /opt/wildfly/bin/ directory:

sudo cp /opt/wildfly/docs/contrib/scripts/systemd/ /opt/wildfly/bin/

The scripts inside bin directory must have executable flag :

sudo sh -c 'chmod +x /opt/wildfly/bin/*.sh'

The last step is to copy the systemd unit file named to the /etc/systemd/system/ directory:

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

Notify systemd that we created a new unit file:

sudo systemctl daemon-reload

Start the WildFly service by executing:

sudo systemctl start wildfly

Check the service status 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 Sun 2019-02-17 04:59:39 PST; 2s ago
 Main PID: 10005 (
    Tasks: 62 (limit: 2319)
   CGroup: /system.slice/wildfly.service

Enable the service to be automatically started at boot time:

sudo systemctl enable wildfly

Step 5: Adjust the Firewall

If your server is protected by a firewall and you want to access WildFly interface from the outside of your local network you need to open port 8080.

To allow traffic on port 8080 type the following command:

sudo ufw allow 8080/tcp
When running a WildFly application in a production environment most likely you will have a load balancer or reverse proxy and it’s a best practice to restrict access to port 8080 only to your internal network.

Step 6: Configure WildFly Authentication

Now that WildFly is installed and running the next step is to create a user who will be able to connect using the administration console or remotely using the CLI.

To add a new user use the script that is located the WildFly’s bin directory:

sudo /opt/wildfly/bin/

You’ll be asked what type of user do you wish to add:

What type of user do you wish to add? 
 a) Management User ( 
 b) Application User (

Select a and hit Enter:

Next, the script will prompt you to enter the details of the new user:

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : linuxize
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 'linuxize' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'linuxize' to file '/opt/wildfly-16.0.0.Final/standalone/configuration/'
Added user 'linuxize' to file '/opt/wildfly-16.0.0.Final/domain/configuration/'
Added user 'linuxize' with groups  to file '/opt/wildfly-16.0.0.Final/standalone/configuration/'
Added user 'linuxize' with groups  to file '/opt/wildfly-16.0.0.Final/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 <secret value="UGFuMjNkZWo3NyNA" />

The new user will be added to the properties files used for authentication.

Step 6: Test the WildFly Installation

To access the default WildFly page, open your browser and type: http://<your_domain_or_IP_address>:8080

Assuming the installation is successful, a screen similar to the following will appear:


Step 7: Access WildFly Administration Console

Command-Line Interface

To access the WildFly Administration Console from the command line you can use the script.

Navigate to the WildFly’s bin directory and run the script with the --connect option:

cd /opt/wildfly/bin/./ --connect

You will be asked to enter your administrative username and password (created in step 6):

Authenticating against security realm: ManagementRealm
Username: linuxize

Once you login the console prompt will change to [standalone@localhost:9990 /]. Type help to get a list of commands and command syntax.

From here, you can deploy and undeploy your applications, manage users and groups and configure and monitor WildFly server.

Web Interface

If you prefer to manage your server from the GUI, WildFly also provides a web-based console.

By default, the WildFly administration console is available only from localhost at http://localhost:9990/console. Sign in using the user you have created in step 6.

WildFly Administration Console

If you want to access the console from remote locations you’ll need to make small modifications to the wildfly.service, wildfly.conf and files.

Open the wildfly.conf and append WILDFLY_CONSOLE_BIND= at the end of the file.

# The configuration you want to run

# The mode you want to run

# The address to bind to

# The address console to bind to

Open the and edit the highlighted lines:


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

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

Restart the service for changes to take effect:

sudo systemctl restart wildfly

Open the wildfly.service and edit the highlighted lines:

Description=The WildFly Application Server



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

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

Notify systemd that the unit file was changed:

sudo systemctl daemon-reload

Restart the WildFly service by executing:

sudo systemctl restart wildfly

Assuming that port 9990 is not blocked in your firewall, you should be able to access the WildFly administration console at http://<your_domain_or_IP_address>:9990/console.


You have successfully installed WildFly on your Ubuntu 18.04 system. You can now visit the official WildFly Documentation and learn more about the WildFly features.

If you hit a problem or have feedback, leave a comment below.