# CLI Decommission Node

The `pf9ctl decommission-node` command detaches the node from the cluster, deauthorize it, and then removes it from Platform9.

## Syntax Example

{% tabs %}
{% tab title="Bash" %}

```bash
pf9ctl decommission-node [flags]
```

{% endtab %}
{% endtabs %}

## All Available Commands and Flags

{% tabs %}
{% tab title="Bash" %}

```bash
pf9ctl decommission-node --help
Removes the host agent package and decommissions this node from the Platform9 control plane.

Usage:
  pf9ctl decommission-node [flags]

Flags:
  -h, --help         help for decommission-node
      --mfa string   MFA token

Global Flags:
      --no-prompt   disable all user prompts
      --verbose     print verbose logs
```

{% endtab %}
{% endtabs %}

## Command Example

{% tabs %}
{% tab title="Bash" %}

```bash
# ./pf9ctl decommission-node
New version found. Please upgrade to the latest version
✓ Loaded Config Successfully
Removing packages
(Reading database ... 140475 files and directories currently installed.)
Removing pf9-comms (5.4.0-979.1d99945) ...
Removing pf9-kube (1.21.3-pmk.35) ...
```

{% endtab %}
{% endtabs %}

Note: If the node was used with proxy configuration, following file needs to be deleted from the node to use without proxy or a new configuration : `/etc/systemd/system/containerd.service.d/00-pf9-proxy.conf`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform9.com/managed-kubernetes/5.14/pmk-cli/pmk-cli-commands/cli-decommission-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
