How has the recent turmoil within the OpenAI offices changed your plans to use GPT in a business process or product in 2024?
Increased uncertainty means we are more likely to evaluate alternative AI chatbots and LLMs.
No change in plans, though we will keep an eye on the situation.
With Sam Altman back in charge, we are more likely to go all-in with GPT and LLMs.
What recent turmoil?
Software Development

How to Deploy a Java App with the Wildfly Application Server

Want to know what else you can use the Wildfly application server for? Discover how to deploy a Java app in this tutorial.
Feb 24th, 2022 9:00am by
Featued image for: How to Deploy a Java App with the Wildfly Application Server

Wildfly is a modular, lightweight Java application server that is maintained by Red Hat and is free to deploy to your data center or third-party cloud host. We’ve covered the deployment of Wildfly on a Ubuntu Server 20.04 instance and now we’re going to take that a step farther and see how easy it is to deploy a Java application with the platform.

To make this work, you’ll need the following:

  • A running instance of Wildfly
  • A sample Java application to deploy

Before we demonstrate the actual deployment, we have to create a deployable Java application. For that, we’ll turn to the tried and true Hello, World!

Install the Java JDK

To create the Java application, we’re going to need a bit of help from the Java JDK. Since we’re demonstrating on Ubuntu, the installation of the Java JDK is quite simple. Log into your Ubuntu machine, open a terminal window, and issue the command:

sudo apt-get install default-jdk -y

The installation will take care of all the necessary dependencies. When it completes, you can verify the installation with:

java --version

You should see something like the following in the output:

Build a Java application

Next, we’re going to build a simple Java application. With Wildfly, you can deploy file types such as EJB-JAR, WAR, EAR, or any kind of standard archive (such as RAR). We’ll be creating a WAR archive for our Java deployment.

To being, create a new directory with the command:


Change into that newly created directory with the command:


In that directory create two more directories with the commands:

Next, create the index.jsp file with the command:

nano index.jsp

In that file, paste the following contents:

<!doctype html>
                <title>JSP Test</title>
                        String title = “Hello World”;
                <h2><%= title %></h2>
                        If you see this, the example war-file was correctly de>
                        <%= new java.util.Date() %>
                        You are from <%= request.getRemoteAddr() %>
                <div id=”conrgrats”></div>

                        #conrgrats {
                                width: 440px;
                                height: 302px;
                                background: no-repeat left center       url(‘d>

Save and close the file.

Next, create the MANIFEST.MF file with the command:


In that file, paste the following:

Where NAME is your name.

Save and close that file.

Create the web.xml file with the command:

nano WEB-INF/web.xml

Paste the following contents into that file:

Save and close the file. If we issue the tree command, we’ll see the structure of your Java application looks like this:

├── index.jsp
└── web.xml

With everything in place, we can now create a .war file with the command:

jar -cvf helloworld.war *

The options are:

  • c – Create a new Jar archive.
  • v – Generates verbose output.
  • f – Sets the file name to what follows the option (in our case helloworld.war.

When the command completes, you’ll find the helloworld.war file in the directory.

Deploy the New Java Application

It’s now time to deploy our Hello, World! Java application. Log into your instance of Wildfly and, from the main page, click Start (under Deployments — Figure 1).

Figure 1

Accessing the Deployment tool in the Wildfly web-based interface.

On the resulting page, drag the helloworld.war file into the Deployment pane on the left side (Figure 2).

Figure 2

The Deployment window allows for easy drag-and-drop addition of supported files.

Once the file has been uploaded, it’ll be listed in the Deployment pane (Figure 3).

Figure 3

Our helloworld.war file has been successfully deployed to Wildfly.

Click on the helloworld.war entry to display the attributes of the application (Figure 4).

Figure 4

The details of our helloworld.war application as seen by Wildfly.

Within the details, you should see a link for the root of the application, listed as /helloworld. If you click on that link, it should take you to the running application (Figure 5).

Figure 5

Running the Hello, World! application gives us a friendly reminder that it’s running as expected.

You can deploy as many applications as you need and they can then be accessed from the server by way of a web browser and an address like http://SERVER:8080/APP/ (where SERVER is either the IP address or DOMAIN of the hosting server and APP is the name of the app. In our case, the app URL would be:

Anyone on your LAN should be able to access that application.

If you want to disable your deployed application, click the drop-down next to View and select Disable (Figure 6).

Figure 6

Disabling our Hello, World application from within Wildfly.


You can also undeploy an app by selecting Undeply from the same drop-down.


Wildfly is a very powerful and simple-to-use Java application server. If you’re looking to deploy a Java-based application to either your LAN, WAN, or from a third-party cloud host, this is a great place to start.

Group Created with Sketch.
TNS owner Insight Partners is an investor in: Bit.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.