Can be installed on both Linux and Windows. Here in this blog I am installing docker engine on ubuntu ec2 instance. Commands will be different for different OS. Official documentation of docker is as below:
sudo apt-get remove docker docker-engine docker.io containerd runc -y
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable" -y
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
Docker would be running as a service on the machine. So as to check if it is working fine, execute the command
sudo systemctl status docker
As of now we are running these commands from a ubuntu user who is having sodoers permission. So as our ubuntu user can directly run the docker commands, let’s add the ubuntu user to the docker group in /etc/group
Now you should be able to run docker commands like docker images, docker ps and many more easily.