LATEST VERSION: 1.10 - CHANGELOG
Pivotal Cloud Foundry v1.9

Installing the cf CLI

Page last updated:

This topic describes how to install the Cloud Foundry Command Line Interface (cf CLI). Follow the instructions below for your operating system. If you previously used the cf CLI v5 Ruby gem, uninstall this gem first.

You can install the cf CLI with a package manager, an installer, or a compressed binary.

Use a Package Manager

Mac OS X Installation

For Mac OS X, perform the following steps to install the cf CLI with Homebrew:

  1. Tap the Cloud Foundry formula repository:
    $ brew tap cloudfoundry/tap
  2. Install the cf CLI:
    $ brew install cf-cli

Linux Installation

For Debian and Ubuntu-based Linux distributions, perform the following steps:

  1. Add the Cloud Foundry Foundation public key and package repository to your system:
    $ wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
    $ echo "deb http://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
  2. Update your local package index:
    $ sudo apt-get update
  3. Install the cf CLI:
    $ sudo apt-get install cf-cli

For Enterprise Linux and Fedora systems (RHEL6/CentOS6 and up), perform the following steps:

  1. Configure the Cloud Foundry Foundation package repository:
    $ sudo wget -O /etc/yum.repos.d/cloudfoundry-cli.repo https://packages.cloudfoundry.org/fedora/cloudfoundry-cli.repo
  2. Install the cf CLI, which also downloads and adds the public key to your system:
    $ sudo yum install cf-cli

Use an Installer

Download the installer for Mac OS X, Windows, or Linux from the cf CLI GitHub repository and follow the instructions for your operating system below.

Windows Installation

To use the cf CLI installer for Windows, perform the following steps:

  1. Unpack the zip file.
  2. Double click the cf CLI executable.
  3. When prompted, click Install, then Close.
  4. To verify your installation, open a terminal window and type cf. If your installation was successful, the cf CLI help listing appears.

Mac OS X Installation

To use the cf CLI installer for Mac OS X, perform the following steps:

  1. Open the .pkg file.
  2. In the installer wizard, click Continue.
  3. Select an install destination and click Continue.
  4. When prompted, click Install.
  5. To verify your installation, open a terminal window and type cf. If your installation was successful, the cf CLI help listing appears.

Linux Installation

To use the cf CLI installer for Linux, perform the following steps:

  1. Install using your system’s package manager. Note these commands may require sudo.
    • For Debian/Ubuntu, run the following command:
      $ dpkg -i path/to/cf-cli-*.deb && apt-get install -f
    • For Red Hat, run the following command:
      rpm -i path/to/cf-cli-*.rpm
  2. To verify your installation, open a terminal window and type cf. If your installation was successful, the cf CLI help listing appears.

Use a Compressed Binary

Download the compressed binary for Mac OS X, Windows, or Linux from the cf CLI GitHub repository and install it on your system.

The specific procedures vary by operating system, but the following example illustrates downloading and installing the binary on Mac OS X:

  1. Download and extract the Mac OS X binary:
    $ curl -L "https://cli.run.pivotal.io/stable?release=macosx64-binary&source=github" | tar -zx
  2. Move it to /usr/local/bin, or another location in your $PATH:
    $ mv cf /usr/local/bin
  3. Confirm your cf CLI version:
    $ cf --version

Next Steps

See Getting Started with cf CLI for more information about how to use the cf CLI.

We recommend that you review our CLI releases page to learn when updates are released, and download a new binary or a new installer when you want to update to the latest version.

Uninstall the cf CLI

Package Manager

If you previously installed the cf CLI with a package manager, follow the instructions specific to your package manager to uninstall the cf CLI.

The specific procedures vary by package manager, but the following example illustrates uninstalling the cf CLI with Homebrew:

$ brew uninstall cf-cli

Installer

If you previously installed the cf CLI with an installer, perform the instructions specific to your operating system to uninstall the cf CLI:

  • For Mac OS, delete the binary /usr/local/bin/cf, and the directory /usr/local/share/doc/cf-cli.

  • For Windows, navigate to the Control Panel, click Programs and Features, select Cloud Foundry CLI VERSION and click Uninstall.

Binary

If you previously installed a cf CLI binary, remove the binary from where you copied it.

cf CLI v5

To uninstall, run gem uninstall cf.

Note: To ensure that your Ruby environment manager registers the change, close and reopen your terminal.

Create a pull request or raise an issue on the source for this page in GitHub