Updated 2025-01-16

Manual and Offline Installations

This section covers how to perform manual and offline installations of the OCI Command Line Interface (CLI):

Manual Installation

Instead of using the installation methods described in the Quickstart or using the OCI CLI Container image, you can manually install the CLI and its dependencies using pip. Before proceeding, be sure you meet the Requirements.

Prior to manually installing the CLI:

  • Make sure your Python path is set correctly
  • Run "python --version" or "python3 --version" and make sure you have the required version
  • If installing on Oracle Linux or CentOS, have the following installed:
    • gcc
    • zlib-devel
    • python3-devel
    • the latest version of OpenSSL 1.1.1
Note

You can also download the CLI installation files and perform an offline installation.

Step 1: Installing Python

Python installation instructions vary for each operating system that the CLI supports.

Note

The CLI supports only the Python versions listed in the CLI Requirements.

Step 2: Creating and Configuring a Virtual Environment

The venv Python module is a virtual environment builder that lets you create isolated Python environments. We recommend installing the CLI in a virtual environment.

Installing and Activating your Virtual Environment

After Python is installed, set up a virtual environment for your operating system using the following steps.

Step 3: Installing the Command Line Interface

You can download the CLI from GitHub or install the package from Python Package Index (PyPI).

To install using the GitHub download:

  • Download and unzip oci-cli.zip.
  • Optionally validate the downloaded file.
  • Run the following command.

    pip install oci_cli-*-py3-none-any.whl

To install using PyPI, run the following command:

pip install oci-cli

For information on how to start a CLI session, see Using the CLI.

Offline Installation

If you have a supported version of Python installed, you can perform an offline installation of the OCI CLI.

To perform an offline installation:
  1. Go to the OCI CLI release page on GitHub and select the version of the CLI that you want to install.
  2. Scroll down to the Assets section of the release page and click on the zip file to download it.
  3. Optionally validate the downloaded file.
  4. Copy the zip file to the target system.
  5. Unzip the zip file.
  6. Run the appropriate installer for the platform:
    1. On Unix and Linux, run bash install.sh --offline-install
    2. On Windows, run install.ps1 -OfflineInstall
  7. Follow the installation prompts.

For troubleshooting offline installs, see Common Issues or create an issue on GitHub.

Installing Without a Virtual Environment

We do not recommend installing the CLI in your system-wide Python and suggest that instead you install the CLI using the installer or virtual environment.

In cases where you are trying to install the CLI in your system-wide Python using the latest pip version, you might encounter conflicts with some distutils installed packages. Following is an example error message when this occurs:

sudo pip install oci-cli
...
...
Cannot uninstall 'requests'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Another option is to install the CLI for the user using the following command, although this approach is not supported:

pip install --user oci-cli

Validating the Release Checksum

After the CLI package is downloaded, you can validate the SHA-256 checksum. Depending on your operating system, use the following instructions to compare the SHA-256 value provided in Github release with the value you get when completing this procedure for your operating system.

Windows
  1. Open a command shell.
  2. Change to the directory where the download file is located.
  3. Run the following command to generate the checksum value, where filename is the name of the downloaded file on your computer:
    certutil -hashfile filename SHA256
  4. Verify that the returned checksum value matches the SHA-256 value provided in the Github release. If the values do not match, please download the file again and repeat this procedure.
Mac OS
  1. Open a terminal window.
  2. Run the following command, where fileLocation is the full path of the file on your computer:
    shasum -a 256 fileLocation 
    This command should return a checksum value.
  3. Verify that the returned checksum value matches the SHA-256 value provided in the Github release. If the values do not match, please download the file again and repeat this procedure.
Linux
  1. Open a terminal session.
  2. Run the following command, where fileLocation is the full path of the file on your computer:
    sha256sum fileLocation

    This command should return a checksum value.

  3. Verify that the returned checksum value matches the SHA-256 value provided in the Github release. If the values do not match, please download the file again and repeat this procedure.