Create a Liberty server manually

To create a server from the commandline...

    cd /path/to/liberty/wlp/bin
    ./server create server_name

server_name must use only Unicode alphanumeric (for example, 0-9, a-z, A-Z), underscore (_), dash (-), plus (+), and period (.) characters. The name cannot begin with a dash or period. The file system, operating system, or compressed file directory might impose more restrictions. If we do not specify a server name, defaultServer is used.

If the server is created successfully, we receive message:

    Server server_name created

If the specified server exists, no server is created and we 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 /wlp/usr/servers/server_name already exists.

A directory with the name of the new server is created under...

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. We can also set these values using variables in a bootstrap.properties file in the same directory.


Create Liberty servers from custom configurations

We can create a server from a custom configuration for any environment that we require. The Liberty server script create command offers a --template option. We can use this option to support server creation from a custom configuration located within a directory...

    templates/servers/<template-name>

Custom server templates must contain at least a server.xml file, and can contain any configuration files, for example: bootstrap.properties or jvm.options.

    server create --template=<extension-name>:<template-name>

Next step: Administer Liberty manually.


Parent topic: Set up Liberty


See also