command: docker node rm
aliases: docker node rm, docker node remove
short: Remove one or more nodes from the swarm
long: |-
    Removes the specified nodes from a swarm.

    > [!NOTE]
    > This is a cluster management command, and must be executed on a swarm
    > manager node. To learn about managers and workers, refer to the
    > [Swarm mode section](/engine/swarm/) in the
    > documentation.
usage: docker node rm [OPTIONS] NODE [NODE...]
pname: docker node
plink: docker_node.yaml
options:
    - option: force
      shorthand: f
      value_type: bool
      default_value: "false"
      description: Force remove a node from the swarm
      details_url: '#force'
      deprecated: false
      hidden: false
      experimental: false
      experimentalcli: false
      kubernetes: false
      swarm: false
inherited_options:
    - option: help
      value_type: bool
      default_value: "false"
      description: Print usage
      deprecated: false
      hidden: true
      experimental: false
      experimentalcli: false
      kubernetes: false
      swarm: false
examples: |-
    ### Remove a stopped node from the swarm

    ```console
    $ docker node rm swarm-node-02

    Node swarm-node-02 removed from swarm
    ```

    ### Attempt to remove a running node from a swarm

    Removes the specified nodes from the swarm, but only if the nodes are in the
    down state. If you attempt to remove an active node you will receive an error:

    ```console
    $ docker node rm swarm-node-03

    Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not
    down and can't be removed
    ```

    ### Forcibly remove an inaccessible node from a swarm (--force) {#force}

    If you lose access to a worker node or need to shut it down because it has been
    compromised or is not behaving as expected, you can use the `--force` option.
    This may cause transient errors or interruptions, depending on the type of task
    being run on the node.

    ```console
    $ docker node rm --force swarm-node-03

    Node swarm-node-03 removed from swarm
    ```

    A manager node must be demoted to a worker node (using `docker node demote`)
    before you can remove it from the swarm.
deprecated: false
hidden: false
min_api_version: "1.24"
experimental: false
experimentalcli: false
kubernetes: false
swarm: true

