Official installation manual address:
https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository
-
Check and uninstall old version of Docker
sudo apt-get remove docker docker-engine docker.io
-
Install some other software
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -
Add official PGP key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
-
Add apt installation configuration:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
-
Installation:
sudo apt-get update
sudo apt-get install docker-ce -
Remove sudo command when using docker:
sudo gpasswd -a username docker
sudo service docker restart
Restart the computer after completion.