github.com/flavio/docker@v0.1.3-0.20170117145210-f63d1a6eec47/docs/reference/commandline/swarm_unlock_key.md (about) 1 --- 2 title: "swarm unlock-key" 3 description: "The swarm unlock-keycommand description and usage" 4 keywords: "swarm, unlock-key" 5 --- 6 7 <!-- This file is maintained within the docker/docker Github 8 repository at https://github.com/docker/docker/. Make all 9 pull requests against that repo. If you see this file in 10 another repository, consider it read-only there, as it will 11 periodically be overwritten by the definitive file. Pull 12 requests which include edits to this file in other repositories 13 will be rejected. 14 --> 15 16 # swarm unlock-key 17 18 ```markdown 19 Usage: docker swarm unlock-key [OPTIONS] 20 21 Manage the unlock key 22 23 Options: 24 --help Print usage 25 -q, --quiet Only display token 26 --rotate Rotate unlock key 27 ``` 28 29 An unlock key is a secret key needed to unlock a manager after its Docker daemon 30 restarts. These keys are only used when the autolock feature is enabled for the 31 swarm. 32 33 You can view or rotate the unlock key using `swarm unlock-key`. To view the key, 34 run the `docker swarm unlock-key` command without any arguments: 35 36 37 ```bash 38 $ docker swarm unlock-key 39 To unlock a swarm manager after it restarts, run the `docker swarm unlock` 40 command and provide the following key: 41 42 SWMKEY-1-fySn8TY4w5lKcWcJPIpKufejh9hxx5KYwx6XZigx3Q4 43 44 Please remember to store this key in a password manager, since without it you 45 will not be able to restart the manager. 46 ``` 47 48 Use the `--rotate` flag to rotate the unlock key to a new, randomly-generated 49 key: 50 51 ```bash 52 $ docker swarm unlock-key --rotate 53 Successfully rotated manager unlock key. 54 55 To unlock a swarm manager after it restarts, run the `docker swarm unlock` 56 command and provide the following key: 57 58 SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8 59 60 Please remember to store this key in a password manager, since without it you 61 will not be able to restart the manager. 62 ``` 63 64 The `-q` (or `--quiet`) flag only prints the key: 65 66 ```bash 67 $ docker swarm unlock-key -q 68 SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8 69 ``` 70 71 ### `--rotate` 72 73 This flag rotates the unlock key, replacing it with a new randomly-generated 74 key. The old unlock key will no longer be accepted. 75 76 ### `--quiet` 77 78 Only print the unlock key, without instructions. 79 80 ## Related information 81 82 * [swarm init](swarm_init.md) 83 * [swarm join](swarm_join.md) 84 * [swarm join-token](swarm_join_token.md) 85 * [swarm leave](swarm_leave.md) 86 * [swarm unlock](swarm_unlock.md) 87 * [swarm update](swarm_update.md)