Insights Hub How to Add a New User to a Cloud Foundry Organization via the CF CLI

Developer Tools Applications


This knowledge article provides step-by-step instructions on how to add a new user to a Cloud Foundry (CF) organization using the Cloud Foundry Command Line Interface (CF CLI). The process involves installing the CF CLI, logging into CF, and assigning roles to the user within the organization. The article also includes optional steps for setting up proxies if behind a corporate firewall.



  1. Install Cloud Foundry Command Line Interface (CF CLI):
    Download and install the CF CLI software from
  1. Open Command Shell:
    On Windows, open the command shell using Start/Execute/cmd.
  1. Set Up Proxies (Optional):
    If behind a corporate firewall, set up proxies by entering the following two lines in the command shell:    
set http_proxy=
set https_proxy=
  1. Log into CF:
    Enter the following command to log into CF:    
cf login -a -sso

    Visit to obtain a One Time Code.

    Login using the WebKey Credentials.

    Copy the One Time Code and use it in the CF CLI for authentication.
  1. Add User to the Organization:
    Once logged in, the admin can add the user to the organization using the following command:
cf set-org-role EMAIL ORG OrgManager
        Replace EMAIL with the user's email address.
        Replace ORG with the organization's name.
        Instead of "OrgManager," other roles can be assigned as needed.

For more details please follow this documentation:


    Ensure that the user performing these actions has the necessary privileges in Cloud Foundry.
    It's important to customize the command based on the desired role and organization.

KB Article ID# KB000128233_EN_US



Associated Components

Cloud Foundry