H2S Forum

How to Install docker container on Ubuntu

Here are the steps to install and use Docker CE container on Linux Ubuntu 19.04/18.04/16.04/14.04.

Update your Ubuntu system

sudo apt-get update

Install HTTPS support for repository

sudo apt-get install apt-transport-https

Add a few miscellaneous things

sudo apt-get install ca-certificates curl gnupg-agent software-properties-common

Fetch GPG key of Docker to add on your Ubuntu system

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add Docker’s Repository on Ubuntu

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Install Docker CE on Ubuntu

This command will install docker, Docker-cli and Docker container

sudo apt-get update
sudo apt-get install docker-ce  

Verify that Docker CE Installation

 sudo docker run hello-world

Install Centos or Ubuntu Docker image (optional)

docker pull ubuntu

or

docker pull centos

Uninstall Docker CE (optional)

sudo apt remove docker-ce
sudo rm -rf /var/lib/docker