Skip to Content

Install the Cloud Foundry Command Line Interface (CLI)

Download and install the CLI, which allows access via the command line.
You will learn
  • How to download the Command Line Interface (CLI) package
  • How to install the CLI and connect it to Cloud Foundry
  • How to explore a few basic CLI commands
IObertMarius ObertMarch 3, 2021
Created by
jonathanbaker7
September 13, 2018
Contributors
jonathanbaker7
IObert
  • Step 1

    Download the latest Command Line Interface (CLI) from the Cloud Foundry web site. Use the following URL:

    https://github.com/cloudfoundry/cli/wiki/V7-CLI-Installation-Guide.

    On the Cloud Foundry website, choose either the command line installer or the binary from the table listed on the webpage. If you don’t know which to use, choose the installer (not the binary) for your Operating System from the table.

    Open the installer on your computer, and follow the installation instructions.

    For more help with the CLI installation, look at the Cloud Foundry CLI installation documentation.

  • Step 2

    Open a command prompt on your computer.

    In Windows, you can search in the start menu for the application “command prompt”.

    On a Mac, use spotlight to find the application “terminal”.

    On Linux/Unix, you know how this works, just open your favorite command shell.

    Next, test the Cloud Foundry command line interface to make sure it is installed correctly.

    To test the CLI, type in the following:

    cf
    

    You should see a list of Cloud Foundry commands.

    Cloud Foundry list of Commands

    Which commands are available to you in the Cloud Foundry CLI (select all that are available)?

  • Step 3

    First, find the correct API URL for your region. Select the correct region from this table, and copy the URL. You will use the URL in the next steps to connect to Cloud Foundry.

    Region URL
    Europe (Frankfurt) AWS https://api.cf.eu10.hana.ondemand.com
    US East (VA) AWS https://api.cf.us10.hana.ondemand.com
    Singapore Azure https://api.cf.ap21.hana.ondemand.com

    If your region is not in this list, check the Regions and API endpoints list for the most up to date list.

    You can also identify your API Endpoint using your Cloud Foundry account:

    First, navigate to the SAP BTP cockpit and select Enter Your Trial Account

    entertrial

    Next, click on the subaccount.

    subaccount

    The API Endpoint is displayed on the left-hand side of the Overview page.

    endpoint
  • Step 4

    Next, open a command line prompt on your computer. In the command line screen, type in the following:

    bash
    Copy
    cf login -a <URL>
    

    Replace the <URL> section with the URL you selected from the table.

    When prompted, enter your username and password. Once you are logged in, you should see your API endpoint, user, org, and space.

    You are now set up to use the SAP BTP, Cloud Foundry environment.

    For more information on the Command Line Interface (CLI), go to the Cloud Foundry Getting Started with the CLI website.

    After you log in to CloudFoundry, the CLI tool lists your API Endpoint, User, Org, and Space.<br/> Which Space is set up for your account?

Back to top