Creating a z/OS Connect (OpenAPI 2) server

Use the zosconnect command to create an IBM z/OS Connect server.

Before you begin

To use the zosconnect command, you must be an IBM z/OS Connect administrator with access to the OMVS shell.

Before you create an IBM z/OS Connect server, ensure that the shared directory is available. For more information, see Creating the IBM z/OS Connect shared directory.

For step-by-step examples of creating a server and connecting it to a System of Record (SoR), see:

About this task

This task shows you how to use the default template to create an IBM z/OS Connect server. Templates are a Liberty feature that you can use when you create a server. Other service providers can supply their own templates to enable a quicker start with their functions. For more information, see Creating Liberty servers from custom configurations in the WebSphere® Application Server Liberty documentation.
Note: The file permissions on the server are controlled by setting the _BPX_BATCH_UMASK STDENV variable. For more information, see _BPX_BATCH_UMASK environment variables in the z/OS UNIX System Service documentation. IBM z/OS Connect server does not use the umask settings in /etc/profile and user’s .profile files.


  1. Optional: Define Liberty environment variables if the default value is not suitable for your configuration.
    Used to specify an alternative location for server generated output such as logs, the workarea directory, and generated files.
    The default is /var/zosconnect.

    Used to specify the location where you want your server instances and user features to be stored. For example, /var/myservers. If you do not set this value, the default /var/zosconnect is used.

    You can specify the WLP_USER_DIR environment variable in the shell environment. This variable must be an absolute path.

    Environment variables can also be used in the server configuration files.

    For example, the following environment variables are automatically set in a Liberty server.
    • server.config.dir -The value is automatically set to the value of the WLP_USER_DIR variable concatenated with the name of the server. For example, /var/zosconnect/servers/serverName.
    • server.output.dir - The value is automatically set to the value of the WLP_OUTPUT_DIR variable concatenated with the name of the server. For example, /var/zosconnect/servers/serverName.
    For more information, see Logging environment variables in the WebSphere Application Server Liberty documentation.
  2. Run the zosconnect command with the create option.
    Use the following syntax:
    zosconnect create <server name> --template=<template name>

    For example, to create a server that is named server1 with the default IBM z/OS Connect template, type the command:

    zosconnect create server1 --template=zosconnect:default
    To create a server for the z/OS application to call REST APIs, you can use the specific template for API requester as in the following command:
    zosconnect create myserver --template=zosconnect:apiRequester

    For more information about server template options, see Supplied server templates in the Reference section.

    Note: You must add the same WLP_USER_DIR environment variable to the started task procedure:
    //STDENV *
    For more information about the started task procedure, see Starting and stopping IBM z/OS Connect.

    For more information about variables and options, see Specifying environment variables and JVM options


A IBM z/OS Connect server is created in the <WLP_USER_DIR>/servers directory with a server.xml configuration file that defines the IBM z/OS Connect feature and the default location of the API archive files, API requester archives, service archives and policy rules. The shared resources and the server definitions are also located in this directory when servers are running.
The following table shows the directory structure and contents when a server is created:
Table 1. Directory paths and contents
Path Contents
<WLP_USER_DIR>/servers Server instances. One subdirectory per server instance, each created by using the create option of the zosconnect command.
<WLP_USER_DIR>/extension The location where user features are installed.

What to do next

To create the z/OS Connect server started task procedure and start or stop the z/OS Connect server, see Starting and stopping IBM z/OS Connect