How to Install WildFly (JBoss) on Debian 9

Published on

7 min read

Install wildfly (JBoss) on Debian 9

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.

In this tutorial we’ll walk you through the steps required to install WildFly application server on Debian 9.


The user you are logged in as must have sudo privileges to be able to install packages.

Installing Java OpenJDK

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

sudo apt updatesudo apt install default-jdk

Createing User

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

Installing 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 that will point to the WildFly installation directory:

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

WildFly runs as a wildfly user that needs to have access to the WildFly installation directory. Change the directory ownership to user and group wildfly:

sudo chown -RH wildfly: /opt/wildfly

Configuring 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. 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 needs to 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/

Reload the systemd manager configuration:

sudo systemctl daemon-reload

Start and Enable the WildFly service to be automatically started at boot time:

sudo systemctl start wildflysudo systemctl enable 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

Adjusting 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.

Configuring 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.

Testing 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:


Accessing 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/

Reload the systemd manager configuration:

sudo systemctl daemon-reload

Restart the WildFly service by running:

sudo systemctl restart wildfly

Assuming that your firewall is not blocking the port 9990, 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 Debian 9 server. You should visit the official WildFly Documentation and learn more about the WildFly features.

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