Change the restart policy of a Docker container
docker restart policy unless-stopped | start docker container on boot | docker update restart | docker | restart | autostartCaution: This command changes the system. Understand what it does before you run it.
docker update --restart unless-stopped appChanges the restart policy of an existing container immediately. unless-stopped restarts the container after crashes and reboots unless it was deliberately stopped before. Other values are no, always and on-failure.
Note: For Compose projects, the restart: value from the Compose file applies again on the next docker compose up, so permanent changes belong there. Docker commands require root or the docker group.
Also searched as
- docker restart policy unless-stopped
- start docker container on boot
- docker update restart