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 jboss-cli.sh script to connect to the remote WildFly application server.
For example:
./bin/jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server
[disconnected /] connect 192.168.0.10:9990
Connected to standalone controller at 192.168.0.1:9990
Next, issue the shutdown command:
shutdown
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 http://192.168.10.1:9990/management --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 192.168.10.1 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.
Recommended Articles
How to Shutdown WildFly Gracefully: A Step-by-Step Guide
Learn how to shutdown WildFly gracefully with a timeout, allowing running requests to complete normally.
Manage JBoss/WildFly Remotely with Web Console and CLI
Learn how to remotely manage your JBoss/WildFly application server with the Web Console, CLI, or external tools like VisualVM and JConsole.
Install and Use WildFly Core as Management Interface for Remote Servers
Learn how to install and utilize WildFly core as a management interface for remote WildFly servers, including installation via Galleon and using the CLI.
Mastering WildFly Management API through HTTP and JSON - A Comprehensive Guide
Learn how to access WildFly's management interface via HTTP and JSON. Discover advantages and use cases. #WildFly #Java #CloudNative