Oracle Cloud Infrastructure Documentation

SDK and CLI Configuration File

Oracle Cloud Infrastructure SDKs and CLI require basic configuration information, like user credentials and tenancy OCID. You can provide this information by:

  • Using a configuration file
  • Declaring a configuration at runtime

The SDKs fully support both options. Refer to the documentation for each SDK for information about the config object and any exceptions when using a configuration file:

The CLI requires a configuration file. --region is the only configuration value that can be passed as a parameter for a CLI operation.

File Name and Location

The default configuration file name and location is ~/.oci/config.


On Windows, you can use PowerShell to create the folder with the following command: mkdir ~/.oci. File Explorer does not support creating folder names that start with a period.

File Entries

The following table lists the basic entries that are required for the configuration file, as well as where to get the required information.

Entry Description and Where to Get the Value Required?

OCID of the user calling the API. To get the value, see Required Keys and OCIDs.

Example: ocid1.user.oc1..aaaaaaaa65vwl75tewwm32rgqvm6i34unq (shortened for brevity)


Fingerprint for the key pair being used. To get the value, see Required Keys and OCIDs.

Example: 20:3b:97:13:55:1c:5b:0d:d3:37:d8:50:4e:c5:3a:34


Full path and filename of the private key.

Important: The key pair must be in PEM format. For instructions on generating a key pair in PEM format, see Required Keys and OCIDs.

If you encrypted the key with a passphrase, you must also include the pass_phrase entry in the config file.

Example: ~/.oci/oci_api_key.pem


Passphrase used for the key, if it is encrypted.

Example: examplephrase

If key is encrypted

OCID of your tenancy. To get the value, see Required Keys and OCIDs.

Example: ocid1.tenancy.oc1..aaaaaaaaba3pv6wuzr4h25vqstifsfdsq (shortened for brevity)


An Oracle Cloud Infrastructure region. See Regions and Availability Domains.

Example: us-ashburn-1


Custom Values

Some Oracle Cloud Infrastructure SDKs support defining custom values in the configuration file. Refer to the documentation for each SDK for more information.


Avoid saving confidential information in the configuration file.

Profiles and Inheritance

You can create multiple profiles with different values for these entries, then you can specify which profile to load.

Some Oracle Cloud Infrastructure SDKs require a DEFAULT profile and support profile inheritance. This means that any value that isn't explicitly defined for a given profile is inherited from the DEFAULT profile. Refer to the documentation for each SDK for more information.

Example Configuration

The following example shows key values in a configuration file and how to set profiles for a SDK that supports profile inheritance.