Step 1: Download the OpenShift CLI (oc)
- Go to the official OpenShift CLI release page:
https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/ - Find the Linux version tarball, for example:
openshift-client-linux.tar.gz - You can download it directly on your RHEL system using curl or wget. For example:
wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz
Step 2: Extract the tarball
tar -xvzf openshift-client-linux.tar.gz
This will extract two binaries: oc and kubectl.
Step 3: Move the oc binary to a directory in your PATH
Commonly, /usr/local/bin is used:
sudo mv oc /usr/local/bin/
sudo mv kubectl /usr/local/bin/ # optional, if you want kubectl too
Step 4: Verify the installation
Check that oc is correctly installed and accessible:
oc version
You should see output with the OpenShift Client version.
Step 5: Authenticate to the Cluster
Before you can run any other oc commands, you will have to authenticate to the cluster. First authenticate to the web console. In the upper right corner, click the drop down for your user profile:

Click Copy login command. You will be prompted to authenticate again using your web console credentials.
Once authenticated click the Display token link. You will be shown a view of your token, a complete oc command with token to authenticate to the API URL, and a curl command to authenticate directly to the API. We will discuss the direct API calls later.

Copy and past the oc login command into your client window. You are not authenticated to the cluster.