Make container start if docker daemon or host system is restarted
You need to add a restart policy to your container.

example:

docker run -dit --restart=always hello-world


In this example, I am telling docker to always restart the hello-world container no matter what happens (and also run it in the background interactively). If you do a docker ps, you will see it keeps restarting. To revert this, you need to update the container restart policy like this:

docker update --restart=no &lt;CONTAINER_ID&gt;