How to Install WildFly (JBoss) on Ubuntu 18.04

By Hitesh Jethva, Alibaba Cloud Community Blog Author.

WildFly is a free, open source and a cross-platform application written in Java and developed by Red Hat. It is simple, lightweight, flexible and based on the pluggable subsystems. It is specially designed to provide users with a fast and stable Java runtime environment. WildFly provides a simple and powerful web interface to manage single or multiple domains efficiently.

In this tutorial, we will explain how to install WildFly on Ubuntu 18.04 server.

Requirements

  • A fresh Alibaba Cloud instance with Ubuntu 18.04 desktop installed.
  • A root password is set up to your instance.

Launch Alibaba Cloud ECS Instance

Create a new ECS instance, choosing Ubuntu 18.04 as the operating system with at least 4GB RAM, and connect to your instance as the root user.

Once you are logged into your Ubuntu 18.04 desktop instance, run the following command to update your base system with the latest available packages.

When you have an account available, log in as your non-root user to begin.

Install Java

WildFly requires Java version 8 to be installed on your server. By default, Java 8 is not available in the Ubuntu 18.04 default repository. So, you will need to download it from their official website.

After downloading Java 8, extract it to the /usr/lib/jvm directory:

Next, set the Java default version with the following command:

Next, verify the Java with the following command:

Output:

Install WildFly

Before installing WildFly, you will need to create a user and group for WildFly. You can create it with the following command:

Next, download the latest version of WildFly with the following command:

Once downloaded, unzip the downloaded file and move it to the /opt/wildfly directory with the following command:

Next, give proper permission to the wildfly directory with the following command:

Configure Systemd File for WildFly

Next, you will need to copy necessary file to configure WildFly.

First, copy WildFly configuration file to /etc/directory:

Next, WildFly launch.sh file to /opt/wildfly/bin/ directory:

Next, copy WildFly systemd file with the following command:

Next, reload the configuration file with the following command:

Next, start the WildFly service and enable it to start on boot time with the following command:

You can now check the status of WildFly with the following command;

Output:

Configure WildFly Authentication

Next, you will need to create an admin user to access the WildFly admin console. You can add it with the following command:

You should see the following output:

Configure WildFly to Access From Remote Location

By default, WildFly is accessible only from localhost. So you will need to configure WildFly to access from the remote location. You can do it by editing /etc/wildfly/wildfly.conf file:

Add the following line:

Save and close the file. Then, open /opt/wildfly/bin/launch.sh file:

Change the file as shown below:

Save and close the file. The, open /etc/systemd/system/wildfly.service file:

Make the following changes:

Save and close the file.

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

Finally, reload the systemd daemon and restart the service for changes to take effect:

Access WidFly Web Console

Now, open your web browser and type the URL http://your-server-ip:9990/console You will be redirected to the following page:

Image for post
Image for post

Provide your username and password. Then, click on the Sign IN button. You should see the WildFly default dashboard in the following page:

Image for post
Image for post

Conclusion

Congratulation! Now we have WidFly installed and a ready-to-use. More information visit: https://wildfly.org/

Thank you to Gary Stevens, CTO at Hosting Canada, for his input into this guide.

Original Source

Written by

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store