There are so many ways can install docker
apt、snap、yum etc…
However the easist way is from the rancher team, with the best compatibility whatever you are using centos or ubuntu
below are the samples of 19.03 and 20.10
sudo curl https://releases.rancher.com/install-docker/19.03.sh | sh
sudo curl https://releases.rancher.com/install-docker/20.10.sh | sh