---
title: "nctl remove cluster"
diataxis: reference
applies_to:
  product: "nctl"
audience: ["developer","platform-engineer"]
last_updated: 2026-04-16
url: https://docs.nirmata.io/docs/nctl/commands/nctl_remove_cluster/
---

## nctl remove cluster

Remove cluster

```bash
nctl remove cluster [flags]
```

### Examples

```bash

  # Remove a cluster using its name
  nctl remove cluster --cluster-name my-cluster

  # Remove a cluster using its unique cluster ID (Overrides name if provided)
  nctl remove cluster --cluster-id my-cluster-id

  # Deregister a cluster from Nirmata Control Hub without uninstalling components
  nctl remove cluster --cluster-name my-cluster --deregister-only

  # Remove only the operator from the cluster without removing other components
  nctl remove cluster --cluster-name my-cluster --remove-operator-only

  # Forcefully remove a cluster, ignoring the kube-system namespace UID check
  nctl remove cluster --cluster-name my-cluster --force

  # Remove a cluster by specifying a custom kubeconfig file and context
  nctl remove cluster --cluster-name my-cluster --kubeconfig /path/to/kubeconfig --kube-context my-context

  # Remove a cluster while allowing connection to an address with a self-signed or unverified certificate (not recommended)
  nctl remove cluster --cluster-name my-cluster --insecure

  # Remove a cluster using Nirmata credentials
  nctl remove cluster --cluster-name my-cluster --token my-nirmata-token --url https://nirmata.example.com

```bash

### Options

```text
      --cluster-id string      the Nirmata Control Hub cluster Id of cluster to be removed (Overrides name. Needed if cluster name is not unique)
      --cluster-name string    the Nirmata Control Hub cluster name of cluster to be removed
      --crd-release string     release name for the operator CRD helm chart (default "kyverno-operator-crd")
      --deregister-only        only deresgisters cluster from nch
      --force                  force remove cluster ignoring empty kube-system namespace uid check
  -h, --help                   help for cluster
      --insecure               allow connection to a Nirmata server with a insecure certificate (not recommended)
      --kube-context string    the kube context from configured kubeconfig. Default is the current or sole context
      --kubeconfig string      kubeconfig path (defaults to $HOME/.kube/kubeconfig)
  -n, --namespace string       namespace in which the operator is deployed (default "nirmata-system")
      --release string         release name for the operator helm chart (default "kyverno-operator")
      --remove-operator-only   remove only operator from cluster, removes all components by default
      --timeout duration       time to wait until the operation terminates (default 10m0s)
      --token string           the Nirmata API Login Key (env NIRMATA_TOKEN)
      --url string             the Nirmata server base URL (env NIRMATA_URL)
```text

### Options inherited from parent commands

```text
  -v, --v Level   number for the log level verbosity
```

### SEE ALSO

* [nctl remove](nctl_remove.md)	 - Remove Nirmata Control Hub resources


