Installing Oracle Cloud CLI tools on a Compute UNIX Box

Installing Oracle Cloud CLI tools on a Compute UNIX Box

If you're working with a Compute Unix system, you'll likely need to install a variety of command-line tools to help you manage your system and applications.

In this guide, we'll walk through the steps to install and configure Oracle Cloud CLI tools on an OL8 Unix box, which has seen significant improvements in the installation process compared to earlier versions.

Let's dive in and see how to get started.

  1. Terminal to your box and run the following, accepting all the defaults (10mins)

     bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
    
  2. When installed, verify the installation

     oci --version
    
  3. Now use the Setup Dialog

     oci setup config
    
  4. When asked for the user OCID... Go into OCI, click on Profile, username, then copy the OCID and paste it into the terminal

  5. When asked for the tenancy OCID... Go into OCI, click on Profile, tenancy, then copy the OCID and paste it into the terminal

  6. When asked for the availability domain, match the home region (see page above), and type the number in.

    I typed 23 for Frankfurt

  7. On the keys section, accept the defaults, however, type N/A when asked for a passphrase

  8. When complete type the below and copy it to the clipboard

      cat ~/.oci/oci_api_key_public.pem
    
  9. In OCI, View the details for the user who will be calling the API with the key pair:

    • If you're signed in as the user:

      Open the Profile menu and click My Profile.

    • If you're an administrator doing this for another user: Open the navigation menu and click Identity & Security. Under Identity, click Users. Select the user from the list.

  10. Click Add API Key > Add API Key > Paste Public Key

  11. Click Add & Close the next window

  12. IMPORTANT: exit terminal and create a new terminal connection

  13. Back in the console, try a command, e.g list users

     oci iam user list
    

    this should return

    {
      "data": [
        {
          "capabilities": {
            "can-use-api-keys": true,
            "can-use-auth-tokens": true,
            "can-use-console-password": true,
            "can-use-customer-secret-keys": true,
            "can-use-db-credentials": true,
            "can-use-o-auth2-client-credentials": true,
            "can-use-smtp-credentials": true
          },
          "compartment-id": "ocid1.tenancy.oc1..aa
    
  14. ENJOY!