How to run WildFly on AWS EC2

In this tutorial I’ll show you how you can install Wildfly application server on Amazon EC2 instance.

The pre-requesite is that you have already your Amazon account available, so you are ready to launch a new Instance:

Wildfly application server on Amazon EC2 instance

In the next Window, choose one of the available Images, for example a RHEL 8:

Wildfly application server on Amazon EC2 instance

You will have to choose the Instance type, which will eventually determine the charge for the service:

Wildfly application server on Amazon EC2 instance

In order to be able to connect to your instance with SSH, you will need to download a Key Pair:

Wildfly application server on Amazon EC2 instance

Download the key and start the Instance. Then fix the permission for the key:

$ chmod 400 /home/user/.ssh/fmarchio-key.pem

Now you can connect to the public address of your instance with SSH using the key;

ssh -i [your-instance-key-pair].pem ec2-user@hostname

As new step, we will install OpenJDK on the machine as follows:

$ sudo yum install java-1.8.0-openjdk-devel

Now, move to the /opt directory and download and extract Wildfly distribution using following commands:

$ cd /opt
$ sudo wget https://download.jboss.org/wildfly/18.0.0.Final/wildfly-18.0.0.Final.zip 
$ unzip wildfly-18.0.0.Final.zip

The application server is ready to be started, however in order to run it as a service we will perform some additional steps as discussed here: How to run WildFly as Service

Finally, when you are done and the application server is started, you can access it via browser at: your-ec2-public-address:8080


Recommended Articles

How to Install WildFly Application Server on Fedora with Java SE and JDK

Learn how to install WildFly application server on Fedora, including Oracle Java SE and OpenJDK. Get step-by-step instructions for setting up the JDK and environment variables.

Install Latest WildFly Application Server on Linux with JDK 17 Support

Learn how to install the latest WildFly application server on a Linux machine. Includes JDK installation options and instructions for RHEL/Fedora and Ubuntu.

Install WildFly Module Using Command Line Interface: A Step-by-Step Guide

Learn how to install a module on WildFly / JBoss EAP using the CLI for efficient and secure application server management.

Install WildFly Application Server on Linux and Windows with JDK Support

Learn how to install WildFly application server on Linux and Windows. Includes JDK support and environment variables setup.