Installing the cf Command Line Interface

Page last updated:

To install the Cloud Foundry Command Line Interface (cf CLI), download it from https://github.com/cloudfoundry/cli#downloads and follow the instructions for your operating system. If you previously used the cf CLI v5 Ruby gem, uninstall this gem first.

Install cf CLI

Windows Installation

To install the cf CLI on Windows:

  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

  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

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

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 cf CLI

Installer

If you previously downloaded and installed a cf CLI installer:

  • 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 downloaded and 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.

View the source for this page in GitHub