# Shutting down by using the command line

From the command line, you can shut down a Network Server by invoking a jar file or a class.

Note that you need to provide user credential arguments to shut down a server running with user authentication.

- To shut down the Network Server by invoking a jar file from the `$DERBY_HOME/lib` directory, use:

      java -jar derbyrun.jar server shutdown [-h <hostname>] [-p <portnumber>] [-user <username>] [-password <password>]

  or

      java -jar derbynet.jar shutdown [-h <hostname>] [-p <portnumber>] [-user <username>] [-password <password>]

- To shut down the Network Server by invoking a class, use:

      java org.apache.derby.drda.NetworkServerControl shutdown [-h <hostname>] [-p <portnumber>] [-user <username>] [-password <password>]

Parent topic: Shutting down the Network Server
Related tasks
Shutting down by using the API