SDK and Tool Configuration

Basic configuration information (for example, user credentials and tenancy OCID) is required in order for the Command Line Interface (CLI) and the SDKs to work. You can provide this information by:

  • using a configuration file (required for the CLI, optional for SDKs)
  • declaring a configuration at runtime (supported for all SDK configuration fields, limited to the region field for the CLI)
  • using a configuration file and declaring a configuration at runtime

SDK Configuration Information

A configuration file is optional for the SDKs listed in SDKs and Other Tools You can provide all the required information programmatically using a config object in the SDK code.

Important: If you provide information in a configuration file and a config object, the object is used and the configuration file is ignored.

Refer to the documentation for each SDK for information about the config object and any exceptions when using a configuration file. For example, the Java SDK does not pick up the region value in a configuration file.

CLI Configuration Information

You must use a configuration file for the CLI. The only configuration value that can be passed as a parameter for a CLI operation is --region. This section provides information about creating a configuration file.

Configuration File Name and Location

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

Windows Users
Because Windows File Explorer doesn't support folder names that start with a period you have to use PowerShell to create the folder. Open the PowerShell console and type: mkdir ~/.oci.

Configuration File Entries

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

Note: If you use a configuration with an SDK, check the SDK documentation to see if there are any SDK-specific configuration entries required.

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: foobar

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


The following example shows key values in a config file. This example has a DEFAULT profile and an additional profile, ADMIN_USER. Any value that isn't explicitly defined for the ADMIN_USER profile (or any other profiles you add to the config file) is inherited from the DEFAULT profile.


# Subsequent profiles inherit unspecified values from DEFAULT.