Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. You can references to documents at this https://www.docker.com/ .
Step 1: Need to update software repositories. Run the following command:
sudo apt-get update
Step 2: Install Docker on Ubuntu 18.04
To install latest version you can run command
sudo apt install docker-ce docker-ce-cli containerd.io
To install specific version docker
apt list -a docker-ce
Output
Then install specific version
sudo apt install docker-ce=<VERSION> docker-ce-cli=<VERSION> containerd.io
You can verify Docker service after install. It is start automation when install completed
sudo systemctl status docker
Output