github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/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 ```bash 38 $ docker node rm swarm-node-02 39 40 Node swarm-node-02 removed from swarm 41 ``` 42 ### Attempt to remove a running node from a swarm 43 44 Removes the specified nodes from the swarm, but only if the nodes are in the 45 down state. If you attempt to remove an active node you will receive an error: 46 47 ```non 48 $ docker node rm swarm-node-03 49 50 Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not 51 down and can't be removed 52 ``` 53 54 ### Forcibly remove an inaccessible node from a swarm 55 56 If you lose access to a worker node or need to shut it down because it has been 57 compromised or is not behaving as expected, you can use the `--force` option. 58 This may cause transient errors or interruptions, depending on the type of task 59 being run on the node. 60 61 ```bash 62 $ docker node rm --force swarm-node-03 63 64 Node swarm-node-03 removed from swarm 65 ``` 66 67 A manager node must be demoted to a worker node (using `docker node demote`) 68 before you can remove it from the swarm. 69 70 ## Related commands 71 72 * [node demote](node_demote.md) 73 * [node inspect](node_inspect.md) 74 * [node ls](node_ls.md) 75 * [node promote](node_promote.md) 76 * [node ps](node_ps.md) 77 * [node update](node_update.md)