Skip to content
STAGE33R

Guides · Reboot and uptime · updated 3 Dec 2026

How to make Docker containers start again after a reboot (restart policies)

A container started with docker run and no restart policy stays stopped after a reboot. The fix is one setting, but it has to be on the container (or in the compose file) and Docker itself must start at boot.

  1. See the policy of every container

    no means it will not come back.

    docker inspect -f '{{.Name}} {{.HostConfig.RestartPolicy.Name}}' $(docker ps -aq)
  2. Change running containers without recreating them

    unless-stopped restarts after reboots and crashes, but not if you stopped the container yourself.

    docker update --restart unless-stopped NAME
    # all running containers:
    docker update --restart unless-stopped $(docker ps -q)
  3. Set it in compose files too

    Otherwise the next docker compose up recreates the container with the old policy.

    services:
      app:
        restart: unless-stopped
  4. Enable the Docker service at boot

    Without it, no container returns.

    sudo systemctl enable docker containerd
    systemctl is-enabled docker

Common mistakes

  • The always policy restarts a container you deliberately stopped when Docker restarts.
  • Containers that depend on each other need depends_on and healthchecks, otherwise the app can start before its database.
  • live-restore keeps containers running while the Docker daemon restarts but does not replace a restart policy for reboots.

How to undo it

docker update --restart no NAME restores the previous behaviour.

Sources

Commands are for Debian and Ubuntu unless noted. Test on a copy first and keep a backup: you are responsible for changes on your own systems.