Installing the stand-alone IBM Cloud CLI
The IBM Cloud® Command Line Interface provides commands for managing resources in IBM Cloud. When you install the stand-alone IBM Cloud CLI, you get only the CLI itself without any recommended plug-ins or tools.
If you want to install both the latest IBM Cloud CLI and other recommended plug-ins and tools for developing applications for IBM Cloud, see Getting started with the IBM Cloud CLI and Extending IBM Cloud CLI with plug-ins.
Before you begin
If you need to use a 32-bit version, or a previous version other than the latest for IBM Cloud Dedicated environments, see IBM Cloud CLI releases.
Installing with an installer
Use the following steps to install the latest stand-alone IBM Cloud CLI:
-
Use a browser to access the official
ibm-cloud-cli-releases
GitHub repository, and select the installer of your OS to begin the download. The following operating systems are supported: macOS X 64-bit, Windows™ 64-bit, Linux™ x86 64-bit, and Linux™ LE 64-bit (ppc64le). -
Run the installer:
- For Mac and Windows™, run the installer.
- For Linux™, extract the package and run the
install
script.
-
Log in to IBM Cloud:
ibmcloud login
Now, you're ready to manage IBM Cloud resources. Enter
ibmcloud help
to view the command descriptions.If you're using a federated ID, log in with a one-time passcode or an API key.
Installing from the shell
To install the latest CLI for your OS from the shell manually, use the following command for your OS:
If you don't want to install from the shell because it might use root permissions, you can download and run the installer.
-
For Mac, copy and paste the following command to a terminal and run it:
curl -fsSL https://clis.cloud.ibm.com/install/osx | sh
-
For Linux™, copy and paste the following command to a terminal and run it:
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
-
For Windows™, copy and paste the following command to a Windows™ PowerShell 5 terminal console and run it:
iex (New-Object Net.WebClient).DownloadString('https://clis.cloud.ibm.com/install/powershell')
If you encounter errors like
The underlying connection was closed: An unexpected error occurred on a send
, make sure that you have .Net Framework 4.5 or later installed. Also try to enable TLS 1.2 protocol by running the following command:[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Installing to a custom directory
When you use installers or a shell script to install the IBM Cloud CLI, it is installed in your system directories. If you want to specify a different directory, use the following steps.
If you install the IBM Cloud CLI to a custom directory, the ibmcloud update
command can't be used to update the CLI.
-
Use a browser to access the official
ibm-cloud-cli-releases
GitHub repository, and select the matching binary of your platform to begin the download. The following platforms are supported: macOS, linux32, linux64, ppc64le, win32, and win64. -
Extract the package to a directory that you specify.
You can see the following extracted content:
For Linux™ and Mac:
IBM_Cloud_CLI ├── LICENSE ├── NOTICE ├── autocomplete │ ├── bash_autocomplete │ └── zsh_autocomplete ├── ibmcloud └── ibmcloud-analytics
For Windows™:
IBM_Cloud_CLI ├── LICENSE ├── NOTICE ├── ibmcloud-analytics.exe └── ibmcloud.exe
-
Add to the
PATH
environment variable and enable shell autocompletion.- Add the
{YOUR_DIRECTORY}/IBM_CLOUD_CLI
to thePATH
environment variable. - For shell autocompletion support (Mac and Linux™ only), see Enabling shell autocompletion for IBM Cloud CLI.
- Add the
Updating the IBM Cloud CLI
Use the latest version of the CLI. If you aren't using the latest version, run the following command to update your CLI:
ibmcloud update
To determine your IBM Cloud CLI version, run the following command:
ibmcloud -v
If you are running the current release, the following output is displayed:
Checking for updates...
No update required. Your CLI is already up-to-date.
To get notified about new IBM Cloud CLI releases, subscribe to the IBM Cloud CLI releases repository.