# OpenShift CLI (oc)

## About this Install Guide

|                            |                     |
|----------------------------|---------------------|
| Reading time:              | 10 min              |
| Last updated:              | 4 Aug 2026          |
| Ecosystem dashboard:       | [View](https://developer.arm.com/ecosystem-dashboard/linux?package=OpenShift) |

| Author:                    | Jason Andrews, Arm [GitHub](https://github.com/jasonrandrews) [LinkedIn](https://linkedin.com/in/jason-andrews-7b05a8) |
| Official docs:             | [View](https://docs.redhat.com/en/documentation/openshift_container_platform/4.22/html/cli_tools/openshift-cli-oc#cli-getting-started) |

This guide shows you how to install and use the tool with the most common configuration. For advanced options and complete reference information, see the official documentation. Some install guides also include optional next steps to help you explore related workflows or integrations.

You can use the OpenShift command-line interface (CLI) to work with OpenShift Container Platform projects from a terminal. You can use OpenShift CLI (oc) to create applications, manage OpenShift Container Platform projects, and perform administrative tasks.

The OpenShift CLI is a superset of the Kubernetes `kubectl` command. When you install `oc`, you get OpenShift-specific functionality such as `oc login`, `oc new-project`, and `oc new-app` to manage OpenShift resources. You also get all standard Kubernetes `kubectl` commands in a single tool. This means you can use `oc` to manage both OpenShift and standard Kubernetes resources.

The OpenShift CLI is available for macOS and Linux and supports the Arm architecture. In this guide, you’ll learn how to install the latest version of OpenShift CLI for Ubuntu on Arm and macOS with Apple Silicon.

## Before you begin

Confirm that you are using an Arm-based computer by running:

```bash
uname -m
```

If you are on Arm Linux, the output should be:

```bash
__output__ aarch64
```

If you are on macOS with Apple Silicon, the output should be:

```bash
__output__ arm64
```

## Download and install the OpenShift CLI

There are multiple ways to install the OpenShift CLI. The following methods download the latest stable version directly from the OpenShift mirror.

### Install on Arm Linux

To install the OpenShift CLI on Arm Linux:

```bash
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux-arm64.tar.gz
tar -xzf openshift-client-linux-arm64.tar.gz
sudo mv oc kubectl /usr/local/bin/
rm openshift-client-linux-arm64.tar.gz README.md
```

### Install on macOS

To install the OpenShift CLI on macOS with Apple Silicon:

```bash
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-mac-arm64.tar.gz
tar -xzf openshift-client-mac-arm64.tar.gz
sudo mv oc kubectl /usr/local/bin/
rm openshift-client-mac-arm64.tar.gz README.md
```

Both installations include both `oc` and `kubectl` commands. The `oc` command provides the full OpenShift functionality, while the `kubectl` command gives you compatibility with standard Kubernetes clusters. Because `oc` is a superset of `kubectl`, you can use `oc` for all Kubernetes operations, but having both commands available gives you flexibility in your workflow.

> You can use either `oc` or `kubectl` to manage standard Kubernetes resources. However, `oc` includes OpenShift-specific features and is preferred for working with OpenShift clusters.

## Verify the OpenShift CLI installation

Verify the OpenShift CLI is installed by checking the version:

```bash
oc version --client
```

The output shows the client version information and is similar to:

```bash
__output__ Client Version: 4.22.7
__output__ Kustomize Version: v5.7.1
```

You can also verify that `kubectl` is available and shows the same version (because it’s the same binary):

```bash
kubectl version --client
```

The output shows the kubectl client version and is similar to:

```bash
__output__ Client Version: v1.35.2
__output__ Kustomize Version: v5.5.0
```

Both commands are now available for managing Kubernetes and OpenShift resources.

## Get started with the OpenShift CLI

To get help with available commands, run:

```bash
oc help
```

This displays the main command groups and options:

```plaintext
__output__ OpenShift Client
__output__ 
__output__ This client helps you develop, build, deploy, and run your applications on any
__output__ OpenShift or Kubernetes cluster. It also includes the administrative
__output__ commands for managing a cluster under the 'adm' subcommand.
__output__ 
__output__ Usage:
__output__   oc [flags]
__output__ 
__output__ Basic Commands:
__output__   login           Log in to a server
__output__   new-project     Request a new project
__output__   new-app         Create a new application
__output__   status          Show an overview of the current project
__output__   project         Switch to another project
__output__   projects        Display existing projects
__output__   explain         Get documentation for a resource
__output__ 
__output__ Build and Deploy Commands:
__output__   rollout         Manage the rollout of a resource
__output__   rollback        Revert part of an application back to a previous deployment
__output__   new-build       Create a new build configuration
__output__   start-build     Start a new build
__output__   cancel-build    Cancel running, pending, or new builds
__output__   import-image    Import images from a Docker registry
__output__   tag             Tag existing images into image streams
__output__ 
__output__ Application Management Commands:
__output__   create          Create a resource from a file or from stdin
__output__   apply           Apply a configuration to a resource by file name or stdin
__output__   get             Display one or many resources
__output__   describe        Show details of a specific resource or group of resources
__output__   edit            Edit a resource on the server
__output__   set             Commands that help set specific features on objects
__output__   label           Update the labels on a resource
__output__   annotate        Update the annotations on a resource
__output__   expose          Expose a replicated application as a service or route
__output__   delete          Delete resources by file names, stdin, resources and names, or by resources and label selector
__output__   scale           Set a new size for a deployment, replica set, or replication controller
__output__   autoscale       Autoscale a deployment or replica set
__output__   secrets         Manage secrets
__output__   serviceaccounts Manage service accounts in your project
__output__ 
__output__ Troubleshooting and Debugging Commands:
__output__   logs            Print the logs for a resource
__output__   rsh             Start a shell session in a pod
__output__   rsync           Copy files between a local file system and a pod
__output__   port-forward    Forward one or more local ports to a pod
__output__   debug           Launch a new instance of a pod for debugging
__output__   exec            Execute a command in a container
__output__   proxy           Run a proxy to the Kubernetes API server
__output__   attach          Attach to a running container
__output__   run             Run a particular image on the cluster
__output__   cp              Copy files and directories to and from containers
__output__   wait            Experimental: Wait for a specific condition on one or many resources
__output__ 
__output__ Advanced Commands:
__output__   adm             Tools for managing a cluster
__output__   create          Create a resource from a file or from stdin
__output__   replace         Replace a resource by file name or stdin
__output__   patch           Update fields of a resource
__output__   process         Process a template into list of resources
__output__   export          Export resources so they can be used elsewhere
__output__   extract         Extract secrets or config maps to disk
__output__   observe         Observe changes to resources and react to them (experimental)
__output__   policy          Manage authorization policy
__output__   auth            Inspect authorization
__output__   image           Useful commands for managing images
__output__   registry        Commands for working with the registry
__output__   idle            Idle scalable resources
__output__   api-versions    Print the supported API versions on the server, in the form of "group/version"
__output__   api-resources   Print the supported API resources on the server
__output__   cluster-info    Display cluster information
__output__   diff            Diff the live version against a would-be applied version
__output__   kustomize       Build a kustomization target from a directory or URL
__output__ 
__output__ Settings Commands:
__output__   logout          End the current server session
__output__   config          Modify kubeconfig files
__output__   whoami          Return information about the current session
__output__   completion      Output shell completion code for the specified shell (bash, zsh, fish, or powershell)
__output__ 
__output__ Other Commands:
__output__   help            Help about any command
__output__   plugin          Provides utilities for interacting with plugins
__output__   version         Print the client and server version information
__output__ 
__output__ Use "oc <command> --help" for more information about a given command.
__output__ Use "oc options" for a list of global command-line options (applies to all commands).
```

To connect to an OpenShift cluster, you need to log in:

```bash
oc login <cluster-url>
```

Replace `<cluster-url>` with the URL of your OpenShift cluster. You’ll be prompted for your username and password.

You are now ready to use the OpenShift CLI to manage your OpenShift Container Platform projects and applications.
