Skip to Content

Install the Cloud Foundry Command Line Interface (CLI)

0 %
Install the Cloud Foundry Command Line Interface (CLI)
// Explore More Tutorials

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

Step 1: Download the Command Line interface

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

On the Cloud Foundry website, choose either the command line installer (if you are set up to use one), 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.

Download matrix from the Cloud Foundry website

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.

Log on to answer question
Step 2: Test the Cloud Foundry CLI

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 certain it is installed correctly.

To test the CLI, type in the following:


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: Determine your Cloud Foundry URL

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
US East (VA) running on Amazon AWS
US West (CA) running on Microsoft Azure
Europe (Frankfurt) running on Amazon AWS
Europe (Netherlands) running on Microsoft Azure

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 Cloud Platform Cockpit and click Log On.

New project from template

Next, click on the subaccount.

New project from template

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

New project from template
Log on to answer question
Step 4: Connect the CLI to the cloud region

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

cf api [URL]

Replace the [URL] section with the URL you selected from the table.

Set the Command Line region URL
Log on to answer question
Step 5: Log in using the CLI

In the same command prompt (from the previous step) type in the following command:

cf login

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

Login to the region using the CLI
After you log in to CloudFoundry, the CLI tool lists your API Endpoint, User, Org, and Space.
Which Space is set up for your account?

You are now set up to use the Cloud Foundry systems on SAP Cloud Platform.

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

Next Steps

Back to top