Saturday, May 11, 2024
OpenShift

How to install OpenShift CLI (oc) on Linux/Windows

Detailed steps on downloading and installing OpenShift CLI on Linux & Windows. You can watch the video or follow the text.

Connect to your RedHat OpenShift Container Platform. Click on the “?” question mark on the top right, and click on “Command Line Tools”

On RedHat OpenShift Container Platform window, click on the question mark on top right and select command line tools

As you can see below, you can download the required versions of oc client from here

on Openshift console under command line tools select the required oc client binary for download

Another option is to download it directly from OpenShift mirror repo.

https://mirror.openshift.com/pub/openshift-v4/clients/ocp/

Download red hat openshift cli directly from openshift repository
red hat openshift download repository

To install on Linux follow these steps below

Untar it

  • Now set the path and restart .bashrc
  • export PATH=/PathOfTheOCfile:$PATH
  • source .bashrc

To install on Windows follow these steps below

On Windows download it to some folder, unzip it

Openshift client download for windows

Now add the path to environment variables. In my case, I have copied it to C:/OpenShift/CLI/oc

set path to environment variables for openshift cli

Let’s check the path is set properly.  As you see the path is correct

Now check the oc client version

how to check openshift cli version

That’s all, we can now connect to an OpenShift cluster using oc.  I will be adding more training on how to use oc client and handy set of useful commands soon.

Back To Top
error: Content is protected !!