# Starting the Network Server

Note that you should always properly shut down the Network Server after use, because failure to do so might result in unpredictable side-effects, such as blocked ports on the server.

Use the startNetworkServer.bat script to start the Network Server on Windows machines and the startNetworkServer.ksh script to start the Network Server on UNIX systems. These scripts are located in $DERBY_HOME/frameworks/NetworkServer/bin, where $DERBY_HOME is the directory where you installed Derby.

You can run NetworkServerControl commands only from the host that started the Network Server.

To start the Network Server, you run the appropriate script from the command line. For example, on a Windows system, if you have installed Derby in the default directory on the C drive and you have set up your classpath correctly, type the following command:

    $DERBY_HOME\frameworks\NetworkServer\bin\startNetworkserver.bat

The default system directory is the directory in which Derby was started. (See the Java DB Developer's Guide for more information about the default system directory.)
Tip: You can set $DERBY_HOME\frameworks\NetworkServer\bin in your path to shorten the command.

By default, the Network Server will listen to requests only on the loopback address, which means that it will only accept connections from the local host.

- Altering the startNetworkServer script
- Starting the Network Server without using the script
- Starting the Network Server from a Java application
- Starting the Network Server on IPv6/Ipv4 dual stack Windows machines

Parent topic: Using the Network Server with preexisting Derby applications
Related concepts
The Network Server and JVMs
Accessing the Network Server by using the network client driver
Accessing the Network Server by using a DataSource
XA and the Network Server
Using the Derby tools with the Network Server
Differences between running Derby in embedded mode and using the Network Server
Related tasks
Installing required jar files and adding them to the classpath
Shutting down the Network Server
Obtaining system information
Setting port numbers