You can follow below steps to install docker-ce in Ubuntu -
install the dependencies first
sudo apt install apt-transport-https ca-certificates curl software-properties-common
add the GPG key for the official Docker repository to the system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add the Docker repository in sources.list.d to APT sources using below command -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable edge"
verify if you are able to install Docker from Docker repository
apt-cache policy docker-ce
Finally, install Docker CE package with below command
sudo apt-get install -y docker-ce
Voila, you have installed Docker-CE. You can verify installation by checking the version of docker-ce installed
docker --version
For more detailed instructions, follow this tutorial