← All notes

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

Sources

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

Permanent ID: iil:note:0zm5a4rp

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.},
}

Markdown

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.

All artifact files (JSON index)

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.