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 [options]
serverName

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

This command is subject to the following 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 following 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 already exists, then no server is created and you receive an exception message.

Options

Options for the server create command
OptionDescription

--no-password

When this option is specified, no default keystore password is generated when the server is created.

--template=templateName

This option specifies the name of a template to use when a new server is created. The template is a customized server.xml or client.xml file with pre-configured features and settings for a particular programming model. For example, server create myServer --template=jakartaee10.

By default, the available templates are in the wlp/templates/servers and wlp/templates/clients directories.

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

This code indicates successful completion of the requested operation.

1

This code 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.