Skip to content

Web Terminal Operator

Red Hat Documentation

The Web Terminal Operator provides an embedded command-line terminal in the OpenShift web console. It gives developers and administrators quick access to oc, kubectl, and other CLI tools directly from the browser without needing a local terminal or SSH session.

Info

The Web Terminal Operator requires cluster administrator privileges to install, but once installed, any authenticated user can open a terminal session from the web console.

Install the Operator via WebUI

  1. Go to Ecosystem -> Software Catalog -> filter for "Web Terminal" -> click the "Web Terminal" tile (provided by Red Hat)
  2. Click Install
  3. Leave all the defaults and click Install
  4. Wait for the Operator to install
Install the Operator via YAML (click to expand)
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: web-terminal
  namespace: openshift-operators
spec:
  channel: fast  # Web Terminal only publishes on 'fast' — there is no 'stable' channel for this operator
  name: web-terminal
  source: redhat-operators
  sourceNamespace: openshift-marketplace
  installPlanApproval: Automatic
oc apply -f web-terminal-operator.yaml

Wait for the operator:

oc get csv -n openshift-operators -w

The PHASE should show Succeeded.

Using the Web Terminal

  1. Log in to the OpenShift web console
  2. Click the command-line terminal icon ( >_ ) in the upper-right corner of the console
  3. Select the project where the terminal workspace will run (a DevWorkspace is created in that project)
  4. The terminal session opens in a panel at the bottom of the console

The terminal comes pre-loaded with common CLI tools including oc, kubectl, kn, tkn, helm, subctl, and odo.

Tip

The terminal session runs as a DevWorkspace pod in the selected project. Sessions have configurable idle timeouts — by default, inactive terminals are shut down after 15 minutes.

Configure Idle Timeout

In OCP 4.22 and later, the supported cluster-wide method to configure the web terminal idle timeout is through the Console UI:

  1. Navigate to Administration → Cluster Settings → Configuration → Console
  2. Click Customize → Web Terminal
  3. Set the desired idle timeout value

Configure Network Policies

If your cluster uses network policies that restrict pod communication, web terminal workspace pods need egress to the OpenShift API server. Example allow-all egress for a project where terminals run (tighten for production):

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-from-openshift-console
spec:
  podSelector: {}
  ingress:
    - from:
        - namespaceSelector:
            matchLabels:
              kubernetes.io/metadata.name: openshift-console
  policyTypes:
    - Ingress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-from-openshift-operators
spec:
  podSelector: {}
  ingress:
    - from:
        - namespaceSelector:
            matchLabels:
              kubernetes.io/metadata.name: openshift-operators
  policyTypes:
    - Ingress
oc apply -f web-terminal-networkpolicies.yaml

If terminals fail to connect, also confirm DNS and that the project can reach the Kubernetes API service.

Uninstall

To remove the Web Terminal Operator:

  1. Go to Ecosystem -> Installed Operators -> Web Terminal
  2. Click the Actions menu -> Uninstall Operator
  3. Clean up any remaining DevWorkspace resources:
oc get devworkspaces --all-namespaces
oc delete devworkspaces --all -A

Verify

oc get csv -n openshift-operators | grep web-terminal
oc get pods -n openshift-operators -l app.kubernetes.io/part-of=web-terminal-operator

The operator pod should be in Running state, and the web terminal icon should be visible in the console toolbar.