← All notes

Docker restart policies: start containers automatically

Answer: Docker restart policies control whether containers start automatically.

How they differ from live restore

The policies apply when containers exit, or when Docker restarts.

Docker recommends restart policies, and warns against using process managers to start containers.

The live-restore flag on the dockerd command is a different mechanism.

During a Docker upgrade, that flag can keep containers running.

Policy values

The no policy is the default and does not automatically restart the container.

The on-failure policy restarts a container that exits with a non-zero exit code.

The always policy restarts the container if it stops.

The unless-stopped policy is similar to always, except a stopped container is not restarted after the daemon restarts.

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., Start containers automatically; Docker, Inc., Start containers automatically (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., Start containers automatically; Docker, Inc., Start containers automatically (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.

Cite this

Permanent ID: iil:note:jgbjn82z

iinventedlight. 2026. "Docker restart policies: start containers automatically." iinventedlight Library, iil:note:jgbjn82z, version of 2026-11-26. https://iinventedlight.com/library/notes/docker-start-containers-automatically/. License: CC-BY-4.0.

@misc{iil_note_jgbjn82z,
  author = {{iinventedlight}},
  title = {{Docker restart policies: start containers automatically}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-26},
  url = {https://iinventedlight.com/library/notes/docker-start-containers-automatically/},
  note = {Permanent ID iil:note:jgbjn82z. 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-start-containers-automatically.md.