How to manage a WildFly / JBoss EAP Domain

The application server domain can be managed from the Web admin console or as well using the Command Line Interface. In this tutorial we will show how to operate on the Command Line Interface to perform basic management operations.

How to manage WildFly JBoss EAP Domain Servers

The default state of the Servers is dictated by the configuration of the Host Controller, where it’s specified is a Server requires auto-start.

Once the Host Controller is active, you can however manage the state of Server easily through the Command Line Interface. Let’s see how to peform the basic maintenance operations.

In order to stop a Server, you need to operate on the server-config path of the Host Controller:

"outcome" => "success",
"result" => "STOPPING"

TIP: You force stopping a Server by using the kill() command which sends a kill -9 signal to interrupt abruptly the Server.

In order to start a Stopped Server you can use the equivalent start() command:

"outcome" => "success",
"result" => "STOPPING"

TIP: You can perform a stop and start in a single operation using the restart command.

Since WildFly 9 / EAP 7 it is possible to execute the suspend operation. When a server is suspended it will immediately stop accepting new requests, but wait for existing request to complete.

The required command to suspend a running Server is:


TIP: It is a good idea to use suspend before shutting down a Server to enable the server to gracefully finish processing all active requests and then shut down.

On the other hand, you can resume a suspended Server as follows:


Adding or removing WildFly Servers to a Domain

In order to add a new Server, we need to point the Host Controller which will contain the new Server and define at least the Server Group it belongs. To avoid conflicts, it is recommended to define in the same context, the socket-binding-port-offset:


You can check the list of servers by stepping into the Host Controller’s path and executing an “ls” of the server element as follows:

cd /host=host1
ls server
server-five   server-one    server-two 

Conversely, you can remove a Server by using the remove command. The server needs however to be stopped before it can be removed:

    "outcome" => "success",
    "result" => "STOPPING"

How to manage WildFly Server Groups

As we have discussed for the single Servers, it is possible to perform the same operations (start/stop/suspend/resume/kill) also on the Server Groups. The advantage is that the operations will be performed on all Servers belonging to a Server Group.

For example, in order to start all Servers belonging to the man-server-group, you can execute the following command on our Domain:


The opposite operation (stop) can be executed as follows:


In order to add a new Server group, you can execute the add operation against the /server-group top element as follows. The mandatory attributes are the Server Group’s profile and its Socket Binding Group:

/server-group=new-server-group:add(profile=full, socket-binding-group=full-sockets)
    "outcome" => "success",
    "result" => undefined,
    "server-groups" => undefined

Remove the Server Group as follows:


Performing Domain-wide start/stop

An useful shortcut to start, stop or resume all Servers in a Domain is to start with a colon (“:”) which will trigger the following commands:


TIP: You can also set a timeout on each operation, by including the timeout=x parameter between parenthesis