{
  "id": "docker-restart-policies-table",
  "kind": "table",
  "slug": "docker-restart-policies",
  "iil_id": null,
  "note_url": "https://iinventedlight.com/library/notes/docker-restart-policies/",
  "title": "docker run --restart picks no, on-failure, always or unless-stopped",
  "columns": [
    "name",
    "source",
    "detail"
  ],
  "rows": [
    {
      "name": "no",
      "source": "Docker docs (Engine)",
      "detail": "Don't automatically restart the container (default)."
    },
    {
      "name": "on-failure[:max-retries]",
      "source": "Docker docs (Engine)",
      "detail": "Restart if it exits due to an error (non-zero exit code); optionally limit retries. A daemon restart does not restart the container."
    },
    {
      "name": "always",
      "source": "Docker docs (Engine)",
      "detail": "Restart the container whenever it stops. If manually stopped, it's restarted only when the Docker daemon restarts or the container is manually restarted."
    },
    {
      "name": "unless-stopped",
      "source": "Docker docs (Engine)",
      "detail": "Like always, except that a stopped container isn't restarted even after the Docker daemon restarts."
    }
  ],
  "related_slugs": [
    "docker-compose-basics",
    "docker-cli-readonly"
  ],
  "license": "CC-BY-4.0",
  "source_license": "Apache-2.0 (Docker docs (Engine)); Apache-2.0 (Docker docs (CLI reference)); prose restates cited source lines in own words",
  "as_of": "2026-11-18",
  "status": "fill-draft-20261118",
  "note": "Restated from the note's GREEN sources; check those sources before relying on a value."
}