How to Install WildFly (JBoss) on Ubuntu 18.04


  • 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

apt-get update -y

Install Java

mkdir /usr/lib/jvm/
tar -zxvf jdk-8u221-linux-x64.tar.gz -C /usr/lib/jvm/
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_221/bin/java 1
java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

Install WildFly

groupadd -r wildfly
useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly
mv wildfly-17.0.1.Final /opt/wildfly
chown -RH wildfly: /opt/wildfly

Configure Systemd File for WildFly

mkdir -p /etc/wildfly
cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/
cp /opt/wildfly/docs/contrib/scripts/systemd/ /opt/wildfly/bin/
sh -c 'chmod +x /opt/wildfly/bin/*.sh'
cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/
systemctl daemon-reload
systemctl start wildfly
systemctl enable wildfly
systemctl status wildfly
● wildfly.service - The WildFly Application Server
Loaded: loaded (/etc/systemd/system/wildfly.service; disabled; vendor preset: enabled)
Active: active (running) since Sat 2019-08-03 09:10:00 UTC; 7s ago
Main PID: 15938 (
Tasks: 52 (limit: 1098)
CGroup: /system.slice/wildfly.service
├─15938 /bin/bash /opt/wildfly/bin/ standalone standalone.xml
├─15943 /bin/sh /opt/wildfly/bin/ -c standalone.xml -b
└─16003 java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m
Aug 03 09:10:00 hitesh systemd[1]: Started The WildFly Application Server.

Configure WildFly Authentication

What type of user do you wish to add? 
a) Management User (
b) Application User (
(a): a
Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : letscloud
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 'letscloud' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'letscloud' to file '/opt/wildfly/standalone/configuration/'
Added user 'letscloud' to file '/opt/wildfly/domain/configuration/'
Added user 'letscloud' with groups to file '/opt/wildfly/standalone/configuration/'
Added user 'letscloud' with groups to file '/opt/wildfly/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="YWRtaW5AMTIz" />

Configure WildFly to Access From Remote Location

nano /etc/wildfly/wildfly.conf
nano /opt/wildfly/bin/
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
nano /etc/systemd/system/wildfly.service
Description=The WildFly Application Server
mkdir /var/run/wildfly/
chown wildfly:wildfly /var/run/wildfly/
systemctl daemon-reload
systemctl restart wildfly

Access WidFly Web Console


Original Source




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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How an Ecommerce Platform Ensures Consistency in Software Localization

Prepare your SQL interview in less than 10 minutes — Part 1

Architecture Reviews Without The Hassle

Precision T3600 Q4000 E5–1650 V1 3.2 Ghz 16Gb Ram 240Gb SSD

Infrastructure as Code with Resource Orchestration Service

Rewriting the Execution Plan in the EMR Spark Relational Cache

CI/CD with Jenkins — Part 2: Use Jenkins for Continuous Integration

VRChat Safety and Trust System: Changes and Feedback

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
Alibaba Cloud

Alibaba Cloud

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

More from Medium

How to deploy Rest API application using MySQL on the Kubernetes cluster

Getting started with Prometheus Federation in Docker

PART 1 Install of Saas based Appdynamics client on Linux for app server agent

Keycloak Step-Up and Multi-factor Authentication (MFA) for Web Apps and API