How to run WildFly with Docker

This is the first of a set of tutorials about the Docker framework. In this one we will learn how to install the Docker platform on a Linux Centos machine and pull and execute a WildFly image on the top of it.

Firstly, what is Docker ? Docker is a container-based software framework for automating deployment of applications. “Containers” are encapsulated, lightweight, and portable application modules. The major (intended) benefit of using a container is that your application will run consistently on and between any server, be it cloud or dedicated, or of varying operating systems.

Installing Docker

The documentation to install Docker is available here: .

As you can see from the documentation, there are several options to install Docker on your machine. If you want a quick ready to install solution for any Linux machine, simply download the installation script from as follows:

$ curl -fsSL -o

Then, execute the script:

$ sh

If you would like to run Docker as a non-privileged user, you should now consider adding your user to the docker group by executing:

$ sudo usermod $(whoami) -G docker -a

Finally, you will need to log out and log in again. We can check that, effectively, our user is now in the Docker group by checking the output of this command:

$ groups $(whoami)

Great! now your Docker is ready to rock!

Pulling Docker images

Firstly, we will pull the Docker image of WildFly. The latest Docker images of WildFly (27 and newer) are available at

Therefore, to pull WIldFly latest image you can run the following command:

docker pull

wildfly-centos7 image

The new image replaces the image that is now deprecated.

Next, check that the WildFly Docker image is available in your local Docker repository:

$ docker images
REPOSITORY                        TAG             IMAGE ID       CREATED         SIZE           latest          832621dbec56   5 days ago      869MB

Then, in order to start the wildfly application server, simply issue:

docker run -it -p 8080:8080

Here is the Console output:

how to run wildfly on docker

As you can see, the Server has started correctly. Finally, we can check the status of WildFly by executing the “docker ps” command. This command will fetch the Image Status and the Ports engaged by the process:

docker wildfly tutorial

The server process is running and the port 8080 is being forwarded to all available IP Addresses.

Therefore, you can simply access the application server http listener at localhost:8080

wildfly docker tutorial wildfly docker tutorial


Et volià! WildFly served on a Docker image.

Next tutorial we will discuss how to customize the WildFly Docker image and deploy some applications on the top of it: Running WildFly with Docker

Finally, if you want to check the source code of WildFly Docker image, it is available on GitHub: