Installing WildFly (JBoss) Java Application Server on Ubuntu 18.04

WildFly, formerly known as JBoss, is a free and open-source Java application server that implements the Java Enterprise Edition (Java EE) specification. It is cross-platform, running on systems including Windows and Linux. WildFly supports WebSockets, providing applications the ability to utilize optimized custom protocols and full-duplex communication with backend systems.

Installation Guide for WildFly on Ubuntu 18.04 LTS

Requirements

  • An Ubuntu 18.04 server environment.
  • A non-root user with sudo access.
  • A static IP address configured on your server (e.g., 192.168.0.235).

Step 1: Install Java

Since WildFly is written in Java, an installation of Java is required. Execute the following command to install Java:

sudo apt-get install default-jdk -y

After Java is installed, verify the installation by checking the version:

java -version

Sample Output:

openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2, mixed mode)

Step 2: Install WildFly

Download the latest version of WildFly from the official website using the following command:

wget http://download.jboss.org/wildfly/14.0.1.Final/wildfly-14.0.1.Final.tar.gz

After completing the download, extract the archive with:

cd /opt
tar -xvzf wildfly-14.0.1.Final.tar.gz
sudo mv wildfly-14.0.1.Final wildfly

By default, WildFly is bound to 127.0.0.1. To allow access from anywhere on your LAN, change the bind address to your server’s IP address by editing the standalone.xml file:

sudo nano /opt/wildfly/standalone/configuration/standalone.xml

Modify the specified lines:

<subsystem xmlns="urn:jboss:domain:webservices:2.0">
<wsdl-host>${jboss.bind.address:192.168.0.235}</wsdl-host>
<endpoint-config name="Standard-Endpoint-Config"/>

<interface name="management">
<inet-address value="${jboss.bind.address.management:192.168.0.235}"/>
</interface>

<interface name="public">
<inet-address value="${jboss.bind.address:192.168.0.235}"/>
</interface>

Save and close the file. Next, add a user for the management console using the script:

sudo /opt/wildfly/bin/add-user.sh

Fill in the following prompts as required:

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

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : wildflyadmin
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)[  ]: wildfly
About to add user 'wildflyadmin' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'wildflyadmin' to file '/opt/wildfly/standalone/configuration/mgmt-users.properties'
Added user 'wildflyadmin' to file '/opt/wildfly/domain/configuration/mgmt-users.properties'
Added user 'wildflyadmin' with groups wildfly to file '/opt/wildfly/standalone/configuration/mgmt-groups.properties'
Added user 'wildflyadmin' with groups wildfly 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 

Step 3: Access the WildFly Console

Start the WildFly instance using the command:

sudo sh /opt/wildfly/bin/standalone.sh

To access the WildFly web interface, open your web browser and navigate to http://192.168.0.235:8080. You should see the WildFly default page:

WildFly default page

To access the management console, use the URL http://192.168.0.235:9990. You will reach a login page:

Login

Enter your WildFly credentials, and click the OK button. The WildFly management console dashboard will appear:

WildFly Application Server Dashboard

Links

FAQ

What is WildFly?

WildFly is an open-source application server managed by the JBoss Community and is designed to be compliant with the Java EE specification.

Why use WildFly?

WildFly is known for its fast startup times, modular architecture, and cloud-readiness, making it ideal for modern application implementations.

Is WildFly free?

Yes, WildFly is a free and open-source application server under the Apache License.

Can I use WildFly with other operating systems?

Yes, WildFly is cross-platform and runs on Windows, Linux, and other operating systems with Java support.