Docker Installation on Ubuntu

Docker installation system requirements
In order to install docker Ubuntu, you will need to meet the following requirements:
- OS: Linux Ubuntu
- Memory: 512MB RAM (2GB Recommended)
- A sufficient amount of disk and CPU (Dependant on the applications )
- It only works on a 64-bit Linux installation.
- It requires Linux kernel version 3.10 or higher.
i) Check the current kernel version
$ uname -r

ii) Check the current Ubuntu version
$ lsb_release -a

iii) Check if ubuntu is running on 32-bit or 64-bit
$ uname -a

Steps to install docker on Ubuntu
Step 1) To install Docker, we need to use the Docker team’s DEB packages.
Use the below command to install prerequisite Ubuntu packages
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

Step 2) Add the official Docker GPG key with the fingerprint.
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Step 3) Next, Add the Docker APT repository.
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Step 4) Update APT sources using the below Docker command
$ sudo apt-get update

We can now install the Docker package itself.
Step 5) Now, start installing the Docker packages on Ubuntu using the below Docker command
$ sudo apt-get install docker-ce

Step 6) Check the docker version
$ docker --version

Step 7) Check the docker service by running the following command.
$ systemctl status docker

Optional, If you want to run docker as a non-root user then you need to add it to the docker group.
Step 8) Create the docker group if it does not exist
$ sudo groupadd docker

Step 9) Add your user to the docker group.
$ sudo usermod -aG docker $USER

Step 10) Run the following command to activate the changes to groups
$ newgrp docker

Step 11) Check if docker can be run without root
$ docker run hello-world

Reboot if still got an error
$ reboot
Reference:
Docker installation — https://docs.docker.com/engine/install/ubuntu/
Docker post-installation — https://docs.docker.com/engine/install/linux-postinstall/