maya's blog

About programming, aws and ubuntu

Install Docker CE to Ubuntu 18.04

docs.docker.com

How to install Docker CE to Ubuntu 18.04(Bionic Beaver)?

Setup the repository

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Install Docker CE

sudo apt-get update
sudo apt-get install docker-ce
apt-cache madison docker-ce  # show list the available version
sudo apt-get install docker-ce=5:18.09~3-0~ubuntu-bionic  # install 5:18.09~3-0~ubuntu-bionic version

Setup to use Docker as non-root user

sudo usermod -aG docker your-user

So reboot.

Test

sudo docker run hello-world