When i login into an EC2 !!!! Settings for automatically starting the containers on server startup.

  1. Start the instance.
  2. check the docker containers (active or exited)
  3. i have to bring the containers up manually by starting it every time.
  4. let me note the server id on which I am performing the operation. i-0c0559ba3004946e5 i,e docker-testing-server
  5. i started the containers and updated the parameter as below:
docker update --restart unless-stopped $(docker ps -a -q)

6. now i am restarting my ec2 instance,. will see if it works or not.

Great !!! its working, I just started the servers but my containers were up already. docker ps gave me the outputs.