server create command

The server create command creates an Open Liberty server.

Usage examples

Create a server called myserver:

server create myserver

Syntax

Run the command from the path_to_liberty/wlp/bin directory.

server create serverName
serverName

A name for the server. If no server is specified, a server called defaultServer is automatically created.

Naming constraints:

  • Use only Unicode alphanumeric (e.g. 0-9, a-z, A-Z), underscore (_), dash (-), plus (+), and period (.) characters.

  • Do not begin the name with a dash (-) or a period (.).

  • Be aware that your file system, operating system, or compressed file directory might impose more restrictions.

When the server is created successfully, you receive the message: Server serverName created.

A directory with the name of the new server is created under the ${wlp.user.dir}/servers directory, which contains the configuration of the new server. The HTTP port numbers for the new server are assigned to default values and are shown in the generated server.xml file to make it easy to edit them.

If the specified server exists, then no server is created and you receive an exception message:

CWWKE0005E: The runtime environment could not be launched.
CWWKE0045E: It was not possible to create the server called server_name because
the server directory C:\wlp\usr\servers\server_name already exists.

Exit codes

The following exit codes are available for the server create command and the equivalent executable JAR file ws-server.jar:

Exit codes for the server create command
CodeExplanation

0

OK. 0 indicates successful completion of the requested operation.

1

1 indicates invocation of a redundant operation. For example, starting a started server or stopping a stopped server. This code might also be returned by JVM if invalid Java options are used.

>=20

Exit codes that are greater than or equal to 20 indicate that an error occurred while performing the request. Messages are printed and captured in log files with more information about the error.