...

Installing OpenStackClient

Published on

All data is current as of

OpenStackClient (OSC) is a unified CLI client for managing OpenStack services from the terminal. It is convenient for automation, scripting, and performing advanced operations that are not available in the cloud infrastructure control panel.

In this section, we will look at ways to install OSC on various operating systems, including Windows, Linux, and macOS. We will also show how to install Python and other dependencies required for OSC to work.

Installing on Windows

  1. Install Python
    1. Go to the Downloads section on the official Python.org website.
    2. Click Download Python 3.xx.xx in the Download the latest version for Windows section.


    3. Save the Python installer and run it.
    4. Check the Add python.exe to PATH box.
    5. Click Install Now.


      Note: If you do not check Add python.exe to PATH, you will need to manually add the path to Python to the environment variables.
    6. Verify the installation by running the following commands:
       python --version
      py --version
      py -m pip --version

      Expected output and how to interpret it:
      • python –version — prints Python 3.x.x, verifying PATH; if there is an error, add the path to Python to the PATH environment variable.
      • py –version — prints Python 3.x.x, verifying the Python Launcher; if there is an error, reinstall Python with the Install launcher option.
      • py -m pip –version — prints pip x.x (python 3.x), verifying pip; if there is an error, run py -m ensurepip –upgrade and update pip.
  1. Install Microsoft C++ Build Tools
    1. Go to visualstudio.microsoft.com.
    2. Scroll down the page to the Tools for Visual Studio section and, in the Build Tools for Visual Studio 202x card, click Download.


    3. Save the installer locally.
    4. Run the downloaded installer with administrator rights.
    5. Check Desktop development with C++.
    6. Click Install.


  2. Install OpenStackClient
    1. Open Command Prompt (CMD) or PowerShell.
    2. Run:
       pip3 install python-openstackclient
    3. Optional: Verify the installation by running:
       openstack --version
      If the installation was successful, the version of the installed OpenStackClient will be displayed.

Installing on macOS

  1. Update the package manager:
     brew update
  1. Install Python:
     brew install python
  1. Install OpenStackClient:
     brew install openstackclient
    Alternative option:

     python3 -m venv ~/.venvs/osc
    . ~/.venvs/osc/bin/activate
    pip install --upgrade pip
    pip install python-openstackclient

Installing on Linux

This section provides instructions for installing OpenStackClient for various Linux distributions, as well as a universal installation method suitable for any distribution. In all cases, Python must be installed beforehand; its installation procedure is also described here.

After completing the steps, you will be able to verify the correctness of the Python and OpenStackClient installation using the universal method described below.

Debian / Ubuntu

  1. Update the package manager:
     sudo apt update
  1. Install Python:
     sudo apt install -y python3 python3-pip python3-venv
  1. Install OpenStackClient:
     sudo apt install -y python3-openstackclient

RHEL 9

  1. Update packages and the repository cache:
     sudo dnf upgrade --refresh -y
  1. Install Python:
     sudo dnf install -y python3 python3-pip
  1. Enable RDO repositories:
    For RHEL distributions, you must enable CodeReady Builder (CRB), otherwise some dependencies may be unavailable. If CRB is already enabled (or the system is registered with full access), you can skip this step.
     sudo subscription-manager repos \
      --enable=rhel-9-for-x86_64-baseos-rpms \
      --enable=rhel-9-for-x86_64-appstream-rpms \
      --enable=rhel-9-for-x86_64-supplementary-rpms \
      --enable=codeready-builder-for-rhel-9-x86_64-rpms
  1. Install OpenStackClient:
     sudo dnf install -y
    https://trunk.rdoproject.org/rdo_release/rdo-release.el9s.rpm
    sudo dnf clean all && sudo dnf makecache
    sudo dnf install -y python3-openstackclient

AlmaLinux 9 / Rocky Linux 9

  1. Update packages and the repository cache:
     sudo dnf upgrade --refresh -y
  1. Install Python:
     sudo dnf install -y python3 python3-pip
  1. Enable RDO repositories:
    For EL9 distributions (including AlmaLinux and Rocky Linux), you must enable CodeReady Builder (CRB). If CRB is already enabled, you can skip this step.
     sudo dnf install -y dnf-plugins-core
    sudo dnf config-manager --set-enabled crb
  1. Install OpenStackClient:
     sudo dnf install -y https://trunk.rdoproject.org/rdo_release/rdo-release.el9s.rpm
    sudo dnf clean all && sudo dnf makecache
    sudo dnf install -y python3-openstackclient

CentOS Stream 9

  1. Update packages and the repository cache:
     sudo dnf upgrade --refresh -y
  1. Install Python:
     sudo dnf install -y python3 python3-pip
  1. Enable RDO repositories:
    For EL9 distributions (including CentOS Stream 9), you must enable CodeReady Builder (CRB). If CRB is already enabled, you can skip this step.
     sudo dnf install -y dnf-plugins-core
    sudo dnf config-manager --set-enabled crb
  1. Install OpenStackClient:
     sudo dnf install -y centos-release-openstack-ussuri
    sudo dnf clean all && sudo dnf makecache
    sudo dnf install -y python3-openstackclien
    Important: The centos-release-openstack-<release> package must match the version of OpenStack deployed in the cloud. In the example provided, the centos-release-openstack-ussuri package is used for the OpenStack Ussuri release, which was current at the time of writing. If the cloud is upgraded, replace the package with the one corresponding to the release, for example:
    • centos-release-openstack-caracal — for OpenStack Caracal (2024.1, SLURP).
    • centos-release-openstack-dalmatian — for OpenStack Dalmatian (2024.2).
    • centos-release-openstack-epoxy — for OpenStack Epoxy (2025.1, SLURP).

Fedora

  1. Update repositories and the system:
     sudo dnf upgrade --refresh -y 
  1. Install Python:
     sudo dnf install -y python3 python3-pip
  1. Install OpenStackClient:
     sudo dnf install -y python3-openstackclient

openSUSE Tumbleweed

  1. Refresh repositories and update the system:
     sudo zypper refresh
    sudo zypper dup -y
  1. Install Python:
     sudo zypper install -y python3 python3-pip
  1. Install OpenStackClient:
     sudo zypper install -y python3-openstackclient

openSUSE Leap / SLES

  1. Refresh repository metadata:
     sudo zypper refresh
  1. Install Python:
     sudo zypper install -y python3 python3-pip
  1. Install OpenStackClient using the universal method:
     python3 -m venv ~/.venvs/osc
    . ~/.venvs/osc/bin/activate
    pip install --upgrade pip
    pip install python-openstackclient

Arch Linux / Manjaro

  1. Update repositories and the system, then install Python:
     sudo pacman -Syu --noconfirm python python-pip
  1. Install OpenStackClient:
     sudo pacman -S --noconfirm python-openstackclient

Alpine Linux

  1. Update the package list and the system:
     sudo apk update && sudo apk upgrade
  1. Install Python and build packages:
     sudo apk add --no-cache python3 py3-pip
  1. Install OpenStackClient:
     pip3 install --upgrade pip
    pip3 install python-openstackclient

    Note: If the installation fails while building dependencies (cryptography, lxml, etc.), install the packages:
     sudo apk add --no-cache build-base libffi-dev openssl-dev \
         rust cargo python3-dev libxml2-dev libxslt-dev

Universal installation method 

This method is suitable for installing OpenStackClient (OSC) from PyPI into a per‑user isolated environment using pipx. With this approach, the openstack commands will be available directly from the terminal, without activating a virtual environment.

Prerequisites:

The system must have:

  • Python 3 (3.9+ recommended);
  • pip for Python 3;
  • the venv module (required for pipx to work).

Verify that everything is present:

    python3 --version
python3 -m pip --version


Installation into a Per‑User Isolated Environment

When installing OpenStackClient into a per‑user isolated environment, use the following steps to manage the environment.

  1. Install pipx for your user account:
     python3 -m pip install --user pipx
  1. Add ~/.local/bin to PATH (if it hasn’t been added yet):
     python3 -m pipx ensurepath
    export PATH="$HOME/.local/bin:$PATH"
  1. Install OpenStackClient into the isolated environment via pipx:
     python3 -m pipx install python-openstackclient


Updating python-openstackclient

Update openstackclient with the command:

 python3 -m pipx upgrade python-openstackclient

Note: The OpenStackClient version is selected automatically depending on the installed Python version. To get the most up‑to‑date OSC version, update Python beforehand to the latest release supported by your OS.

Verifying the installation on Linux and macOS

  1. Check Python:
     python3 --version
    If Python is installed correctly, this command will print the Python version, for example: “Python 3.12.7”. 
  2. Check pip:
     pip3 --version
    If the Python package manager was installed correctly, this command will print the pip version, for example: “pip 24.0”.
  3. CheckOpenStackClient:
     openstack --version
    If the installation was successful, the OSC version will be printed, for example: “openstack 8.2.0”.

What’s next?

After OpenStackClient is installed, you can obtain authentication data for the cloud infrastructure and use them to connect, as described in the guide: “OpenStackClient Authentication via Environment Variables”.