Setting up OpenStack CLI environment

Updated 3 months ago by Brian Banaszynski

You need to prepare your environment by defining some variables that will be used by the CLI tools when interacting with the OpenStack endpoints.

Below is a sample of an environment variable file that we can then source in our current session.

export OS_AUTH_URL=
export OS_REGION_NAME="<region_name>"
export OS_USERNAME="<>"
export OS_PASSWORD="<your_password>"
export OS_PROJECT_NAME="<your_tenant_name>"
export OS_USER_DOMAIN_NAME=default

You can also navigate to the Access & Security > API Access tab in the portal to obtain the environment variables for that specific portal session. Copy and paste those into a file on your computer to later source.

After you’ve created your RC file, in your terminal session, source it:


Now activate the virtual OpenStack CLI environment. This example assumes you created the virtual environment in your home directory in “.virtualenvs/os_cli”:

source ~/.virtualenvs/os_cli/bin/activate

You can now execute commands against the OpenStack API endpoints.

Refer to the OpenStack Client documentation for additional information on leveraging the CLI.

How Did We Do?