How to make docker container to autostart

When you a have a container that you want to start every time on you computer reboot (or crash), you may just get your favorite container id:

docker ps | grep "any-part-of-upir-favorite-container-name-you-remeber-here"

and use this container-id (that will be 12 alphanumeric string the most left column in the output which is called ‘CONTAINER ID’) to update it’s start policy:

docker update --restart=always container-id

Now you can start your container as usual and not the next reboot it will automatically restart.

docker start container-id

Done! Quick and easy!