How to shut down WildFly remotely?

To shut down JBoss or WildFly remotely, you can use the JBoss Command Line Interface (CLI) or the Management REST API. In this tutorial we will show both approaches.

Two ways to shutdown JBoss or WildFly remotely

If you have a local JBoss/WildFly installation then you can use the local script to connect to the remote WildFly application server.

For example:

You are disconnected at the moment. Type 'connect' to connect to the server
[disconnected /] connect
Connected to standalone controller at

Next, issue the shutdown command:


Please note that you can also issue a server restart, if you want. Read the following article to learn more:  How to Start, Stop and Restart WildFly

On the other hand, if you don’t have a local WildFly installation you can use the HTTP Management API. For example, with curl execute the following command:

curl --digest --header "Content-Type: application/json" -u admin:admin -d '{"operation":"shutdown","blocking":true}'

In the above example, we are shutting down the remote server running on using the credentials admin/admin.

Choose the method that best suits your requirements and access capabilities, and use it to gracefully shut down JBoss or WildFly remotely.