Enable Docker live restore to avoid downtime


The Docker daemon, by default, shuts down running containers when it’s terminated. Due to daemon crashes or upgrades, running containers can be shut down, causing unexpected downtime if the Live Restore feature is not enabled.

Why you should use Docker with live restore enabled

To avoid any surprises and make your environment more reliable, configure the Docker daemon to leave containers running if it becomes unavailable.

How to enable live restore on Docker daemon

You need to add a configuration to the daemon configuration file.

Edit the file /etc/docker/daemon.json, create it if it doesn’t exist yet.

Use the JSON shown below:

  "live-restore": true
There might be more options on your configuration file, make sure you write valid JSON and preserve any initial configuration. Validate your configuration file to be extra careful: jq empty /etc/docker/daemon.json

Then reload the Docker daemon:

sudo systemctl reload docker

To verify that Live Restore is enabled run:

docker info | grep 'Live Restore'
 Live Restore Enabled: true

The configuration Live Restore Enabled must be true.