How to install WildFly on Linux

This tutorial will teach you how to install the latest release of WildFly application server on a Linux box.

The pre-requisite to install WildFly is that you have available a JDK on your machine. 

Installing Java

The most heavily tested SE options for WildFly are still Java 11 and Java 8, because both WildFly and its component library projects have many years of testing on those versions. Since WildFly 25 it is however supported also the latest Java 17 version.

The JDK is available from different sources. Starting from JDK 11, the most popular options are:

In this section, we will show some common options to install openjdk on a Linux machine.

On a RHEL / Fedora machine you would typically install it as follows:

sudo dnf install java-11-openjdk-devel

On Ubuntu, on the other hand, you can use the apt-get tool to install it:

sudo apt-get install openjdk-11-jdk

Once installed the JDK, you have to set the JAVA_HOME environment variable accordingly. Enter in your .profile / .bash_profile script the following (substitute with the actual JDK installation path):

# Path could be different in your jdk installation
export JAVA_HOME=/usr/lib/jvm/open-jdk

Installing WildFly

Done with JDK installation, let’s move to the application server.

You can download WildFly from http://www.wildfly.org by following the Downloads link in the home page. Several distributions are available:

  • WildFly Preview EE 9 Distribution: which allows the deployment of both Jakarta EE 8 and Jakarta EE 9 applications. This distribution targets the cloud environment thanks to its smaller memory footprint.
  • Jakarta EE Full & Web Distribution: which is the stable long term version of WildFly and allows the deployment of Jakarta EE 8 applications.
  • Servlet-Only Distribution: which allows the deployment of Servlet based applications, within the core WildFly container.

If you prefer, you can also install WildFly from the command line as follows (replace the server version with the one you want to install):

wget https://github.com/wildfly/wildfly/releases/download/33.0.2.Final/wildfly-33.0.2.Final.zip

Once downloaded WildFly, extract the archive to a folder and you are done with the installation.

$ unzip wildfly-33.0.2.Final.zip

Starting WildFly

The application server ships with two server modes: standalone and domain mode. The difference between the two modes is not about the capabilities available but is related to the management of the application server: in particular, the domain mode is used when you run several instances of WildFly and you want a single point where you can manage servers and their configuration.

In order to start WildFly using the default configuration in “standalone” mode, change the directory to $JBOSS_HOME/bin and execute:

$ ./standalone.sh

You can verify that the server is running by pointing to http://localhost:8080

install wildfly linux

To start the application server using the default configuration in “domain” mode, change directory to $JBOSS_HOME/bin and execute:

$ ./domain.sh

Further reading: To learn more about WildFly configuration, check the articles included in the “Core Configuration” section.