github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/cli/docs/reference/commandline/node_rm.md (about)

     1  ---
     2  title: "node rm"
     3  description: "The node rm command description and usage"
     4  keywords: "node, remove"
     5  ---
     6  
     7  # node rm
     8  
     9  ```markdown
    10  Usage:  docker node rm [OPTIONS] NODE [NODE...]
    11  
    12  Remove one or more nodes from the swarm
    13  
    14  Aliases:
    15    rm, remove
    16  
    17  Options:
    18    -f, --force   Force remove a node from the swarm
    19        --help    Print usage
    20  ```
    21  
    22  ## Description
    23  
    24  Removes the specified nodes from a swarm.
    25  
    26  > **Note**
    27  >
    28  > This is a cluster management command, and must be executed on a swarm
    29  > manager node. To learn about managers and workers, refer to the
    30  > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the
    31  > documentation.
    32  
    33  ## Examples
    34  
    35  ### Remove a stopped node from the swarm
    36  
    37  ```console
    38  $ docker node rm swarm-node-02
    39  
    40  Node swarm-node-02 removed from swarm
    41  ```
    42  
    43  ### Attempt to remove a running node from a swarm
    44  
    45  Removes the specified nodes from the swarm, but only if the nodes are in the
    46  down state. If you attempt to remove an active node you will receive an error:
    47  
    48  ```non
    49  $ docker node rm swarm-node-03
    50  
    51  Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not
    52  down and can't be removed
    53  ```
    54  
    55  ### <a name="force"></a> Forcibly remove an inaccessible node from a swarm (--force)
    56  
    57  If you lose access to a worker node or need to shut it down because it has been
    58  compromised or is not behaving as expected, you can use the `--force` option.
    59  This may cause transient errors or interruptions, depending on the type of task
    60  being run on the node.
    61  
    62  ```console
    63  $ docker node rm --force swarm-node-03
    64  
    65  Node swarm-node-03 removed from swarm
    66  ```
    67  
    68  A manager node must be demoted to a worker node (using `docker node demote`)
    69  before you can remove it from the swarm.
    70  
    71  ## Related commands
    72  
    73  * [node demote](node_demote.md)
    74  * [node inspect](node_inspect.md)
    75  * [node ls](node_ls.md)
    76  * [node promote](node_promote.md)
    77  * [node ps](node_ps.md)
    78  * [node update](node_update.md)