Setting Up OCI CLI on Windows and Mac: Step-by-Step Guide

Share Post:

Introduction

Oracle Cloud Infrastructure (OCI) CLI (Command Line Interface) is an essential tool for developers and administrators looking to interact with Oracle Cloud services via terminal commands. This tool simplifies managing cloud resources, automates tasks, and integrates with other development environments. Here, we’ll walk through the steps to set up OCI CLI on both Windows and macOS.

Overview of OCI CLI

OCI CLI is a powerful tool that allows you to access and control Oracle Cloud resources. Instead of using the OCI console interface, you can automate operations, manage resources, and customize interactions with OCI services. It’s essential for scripting, handling multiple accounts, and bulk actions.

 

Key Benefits of OCI CLI:

  • Automate cloud infrastructure tasks.
  • Integrate with automation tools like CI/CD pipelines.
  • Access cloud resources quickly and remotely.

Prerequisites

Before installation, ensure that your system meets the following requirements:

  • Python 3: OCI CLI is a Python-based tool. If Python isn’t installed, install it from the official Python website. Version 3.6 or later is recommended.
  • Oracle Cloud Account: You’ll need an OCI account with appropriate permissions.
  • Administrator Access: Some steps may require administrative privileges on your computer.

Installation Steps on Windows

Let’s break down the installation of OCI CLI on a Windows system.

Step 1: Install Python (if not already installed)

    1. Download Python from org.
    2. During installation, check the box “Add Python to PATH”.
    3. After installation, verify by running python –version in Command Prompt.

Step 2: Download and Install OCI CLI

    1. Open Command Prompt as an administrator.
    2. Run the following installation command:

python -m pip install oci-cli

Step 3: Once installed, verify by running:

oci –version

Installing OCI CLI on macOS

Step 1: Install Python (if needed)

  1. Install Homebrew:

/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”

  1. Install Python:

brew install python

  1. Confirm by typing:

python3 –version

Step 2: Install OCI CLI

  1. Open Terminal.
  2. Run:

python3 -m pip install oci-cli

  1. Verify installation with:

oci –version

Configuring OCI CLI

  1. Run:

oci setup config

Enter the required details (User OCID, Tenancy OCID, Region, etc.), found in the OCI Console.

  1. Testing the Installation Run:

oci iam compartment list

If everything’s set up correctly, this will return a list of compartments in your tenancy. With your setup complete, you’re ready to start managing Oracle Cloud resources right from your command line!

In Part 2, we’ll cover cloning boot volumes from one tenancy to another within the same region using OCI CLI.

Contact us today to arrange an assessment or email:

Picture of Jason Beattie

Jason Beattie

Senior Architect and Cloud Operations Manager

Get in touch

Contact us today to learn more about what Vertice can do for you.

Cookies & Privacy

Vertice collects and stores your information to better customise your site experience and to optimise our website. However, your consent is required. Privacy Policy