Docker swarm autolock: unlock managers after a restart
Answer: Autolock keeps a swarm manager's encryption keys protected after Docker restarts, and you must unlock the node with the key before it can rejoin.
Why locking exists
The Raft logs used by swarm managers are encrypted on disk by default. This feature is called autolock. When Docker restarts, you need to unlock the swarm.
docker swarm init --autolock starts a locked swarm. docker swarm update --autolock=true enables autolock. To disable autolock, set --autolock to false.
Unlock and rotate
After a restart, use docker swarm unlock and supply the key. Rotate the key on a regular schedule with docker swarm unlock-key --rotate, and store the new key safely.
See also
Claims
- id: C1 claim: Autolock is the feature that protects keys after restart. source: S1 evidence: "This feature is called autolock."
- id: C2 claim: Use docker swarm unlock to unlock a locked swarm. source: S1 evidence: "Use \"docker swarm unlock\" to unlock it."
- id: C3 claim: Rotate the unlock key on a regular schedule. source: S2 evidence: "You should rotate the locked swarm's unlock key on a regular schedule."
Sources
- [S1] Lock your swarm to protect its encryption key. Docker, Inc.. https://docs.docker.com/engine/swarm/swarm_manager_locking/ . License: Apache License 2.0. Accessed 2026-11-26.
- [S2] Lock your swarm to protect its encryption key (source). Docker, Inc.. https://raw.githubusercontent.com/docker/docs/main/content/manuals/engine/swarm/swarm_manager_locking.md . License: Apache License 2.0. Accessed 2026-11-26.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Lock your swarm to protect its encryption key; Docker, Inc., Lock your swarm to protect its encryption key (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Lock your swarm to protect its encryption key; Docker, Inc., Lock your swarm to protect its encryption key (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.
Cite this
iinventedlight. 2026. "Docker swarm autolock: unlock managers after a restart." iinventedlight Library, iil:note:0zm5a4rp, version of 2026-11-26. https://iinventedlight.com/library/notes/docker-swarm-manager-locking/. License: CC-BY-4.0.
@misc{iil_note_0zm5a4rp,
author = {{iinventedlight}},
title = {{Docker swarm autolock: unlock managers after a restart}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-26},
url = {https://iinventedlight.com/library/notes/docker-swarm-manager-locking/},
note = {Permanent ID iil:note:0zm5a4rp. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- docker-swarm-manager-locking.schema.json (schema; CC-BY-4.0)
- docker-swarm-manager-locking.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-swarm-manager-locking.md.