Wildfly, install this Java EE application server on Ubuntu

about wildfly

In the next article we are going to take a look at WildFly (formerly known as Jboss AS). This is a lightweight, fast and highly optimized Java EE application server based on Java with which large applications can be developed from a single IDE. In the following lines we are going to see how to install it in Ubuntu 18.04.

WildFly is cross-platform. It offers a robust control panel that makes changing a configuration in the application server is very simple and fast. It is not necessary to navigate through unnecessary pages to customize the environment looking for what suits your needs.

Install OpenJDK

java logo
Related article:
Install Java 8, 9 and 10 on Ubuntu 18.04 and derivatives

WildFly is written in Java, that's why requires Java JDK to work. To meet this requirement, users can choose to install Oracle's official Java JDK or use the open source alternative called OpenJDK. For this example, we will opt for the open source version of Java, so in a terminal (Ctrl + Alt + T) we will write:

java jdk installation

sudo apt update; sudo apt install default-jdk

After installing OpenJDK, we can check installation typing in the terminal:

checking java installation

java -version

If the terminal returns some lines like the ones in the previous screenshot, Java will be installed and ready.

Set up the WildFly user

Since this is an application server, generally it is recommended to use a dedicated service account. Run in the terminal (Ctrl + Alt + T) the following commands to create a WildFly service account to manage the server:

sudo groupadd -r wildfly

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

Finished, we continue with the download and installation of WildFly.

Download and install WildFly

Once the Java JDK installation is finished and the creation of a service account for WildFly is finished, we will execute the following commands to download package for WildFly. At this precise moment, the current version is 16.0.0.Final. The latest version available can be consulted in your download page.

If we open a terminal (Ctrl + Alt + T), we can use the wget command to download the package easily using the following commands:

download Wildfly

cd /tmp

wget https://download.jboss.org/wildfly/16.0.0.Final/wildfly-16.0.0.Final.tar.gz

Once the download is finished, we will have to execute the following commands to create WildFly folder in directory / Opt and to change your ownership to the WildFly service account.

tar xvf wildfly-16.0.0.Final.tar.gz

sudo mv wildfly-16.0.0.Final/ /opt/wildfly

sudo chown -RH wildfly: /opt/wildfly

We continue creating the WildFly service folder in the directory / etc / with the following command:

sudo mkdir -p /etc/wildfly

After creating the directory, copy the WildFly configuration files and executables to the directory newly created.

copy the configuration files from this media server

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

We also have to make scripts in directory / etc / wildfly / bin are executable.

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

At this point we will copy systemd file to directory / etc / systemd / system / running:

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

Now we can use the following commands to stop, start and enable the WildFly services to start automatically at boot time:

commands about the Wildfly service

First we stop the service:

sudo systemctl stop wildfly.service

Now we start the service:

sudo systemctl start wildfly.service

And we finished enabling the service:

sudo systemctl enable wildfly.service

For verify start, run the following command:

service status

sudo systemctl status wildfly.service

User account to connect and administer the server web console

Now that you have downloaded and installed the WildFly service, run the following command to create a user account. This will connect and manage the web console of the application server. We will create the account by typing in the terminal (Ctrl + Alt + T):

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

In the menu that can be seen in the screenshot, type "a”And hit Enter:

create user account in Wildfly

Now enter a new username and create your password:

username and password for the service account

Writes "Yes" for complete setup. Now WildFly should be installed and ready.

Wildfly in the browser

We can now open the browser and as URL use the hostname or IP address of the server followed by port 8080.

Wildfly splash screen

http://localhost:8080

Server console is restricted to local server only. If you are interested in connecting from a remote location, information on how to do so can be obtained from your documentation.

Wildfly administration console in the browser

After this we can access the administration console from http://localhost:9990/console remotely then WildFly has been successfully installed on Ubuntu, 18.04 in this case.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Eliana said

    Thanks, it's the only tutorial that works 🙂

  2.   Fernando said

    Fantastic. It saved my life.

  3.   I fishkdo said

    Thanks to it worked, now I'm trying to replicate to have two instances of wildfly running on the same server, if I run it with sh /opt/wildfly2/bin/stanalone.sh, it works correctly, but when I want to create a second service so that work with systemctl start wildlfly2, I can't get it to work. Any recommendation?