How to Shutdown Wildfly Service via Command Line

Posted on

Introduction

There are several ways to shutdown or to turn-off Wildfly service via command line. Before going further to read about how to shutdown Wildfly service via command line, read another article in this link. That is a link to an article with the title of ‘How to Connect to Wildfly Administration Console via Command Line’. It is an article with a specific content to connect to Wildfly Administration. First of all, in order to shutdown Wildfly service, connect to the Wildfly Administration Console. The connection to Wildfly Administration Console is possible using a command line interface.

Stopping Wildfly Service

Normally, the following are steps for shutting down the Wildfly service :

1. Connect to Wildfly Command Console as follows :

user@hostname:~$ /opt/wildfly-17.0.1.Final/bin/jboss-cli.sh 
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /]

2. After successfully connecting to Wildfly Command Console, connect to Wildfly Administration Console with the following command execution :

[disconnected /] connect
Authenticating against security realm: ManagementRealm

Username: admin
Password: 
[standalone@localhost:9990 /]

3. In order to shutdown Wildfly service, execute the following command in the Wildfly Administration Console in the command line interface :

shutdown

In the Wildfly Administration Console via command line interface, the following is the execution of the above command :

[standalone@localhost:9990 /] shutdown
[disconnected /] quit

After shutting down the Wildfly service, it is automatically disconnected from Wildfly Administration Console. It automatically will redirect back to the Wildfly Command Console but it is no longer connected to the Wildfly Administration Console.

Aside from the above steps, there are one simple command in a single line for turning off the Wildfly service. That single line command execution is in the following output for an example :

user@hostname~$ /opt/wildfly-17.0.1.Final/bin/jboss-cli.sh --connect --controller=127.0.0.1:9990 --command=shutdown
Authenticating against security realm: ManagementRealm
Username: admin
Password: 
user@hostname:~$

After succesfully performing the above command for shutting down the Wildfly service, don’t forget to check the status of it. Just to make sure that the service running through Wildfly is completely stop. Learn how to check the status of Wildfly service in an article with the title of ‘How to Check Wildfly Java Application Server running service or process’ in this link.

Leave a Reply