IBM Support

Logging In to IBM Cloud CLI (Using API Key)

How To


Summary

This document explains how to log in to IBM Cloud using the CLI by creating and using an API key from the IBM Cloud UI.
Example of Environment: Environment watsonx.ai Instructlab as a Service

Steps

1. Log in to IBM Cloud

  • 1. Open your browser and go to https://cloud.ibm.com.

  • 2. Sign in using the credentials. 

2. Create an API Key

  • 1. From the IBM Cloud dashboard, go to Manage > Access (IAM) > API Keys.

  • 2. Click Create an IBM Cloud API key.

  • 3. Enter a name and optional description, then click Create.

  • 4. Copy or download the API key — you’ll need it to log in through the CLI.

3. Log in Using the CLI

  • 1. Open your terminal or command prompt.

  • 2. Run the following command:

  •    ibmcloud login --apikey <your_api_key>

4. Verify Login

  • 1. To confirm you’re logged in, run: ibmcloud account show

  • 2. If your account details appear, your authentication was successful.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"","label":""},"Business Unit":{"code":"","label":""},"Product":{"code":"SSNR6KN","label":"IBM Technology Zone"},"ARM Category":[{"code":"a8mKe0000004CUbIAM","label":"Infrastructure-\u003EIBM Cloud"}],"ARM Case Number":"TS019673304","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":""}]

Document Information

Modified date:
30 October 2025

UID

ibm17248255