Run Docker in AWS CloudShell

Open AWS CloudShell.

Run the following command to install and run Docker daemon in background.

sudo yum update -y;
sudo amazon-linux-extras install -y docker;
echo $(nohup sudo dockerd > /tmp/dockerd.log 2>&1 &);

To find process ID number.

pgrep -a dockerd;

To kill process, append the process ID number and run.

sudo kill