Install Docker on Ubuntu 18.04?

Create an apt source-list file with the following content:

/etc/apt/sources.list.d/docker.list

deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic nightly

Update repositories and install the docker engine:

sudo apt update
sudo apt install docker-ce

You can use stable instead of nightly in the deb declaration of the apt source file as soon as it becomes available.


Following link https://download.docker.com/linux/ubuntu/dists/bionic/pool/, You can choose stable now.

$ sudo cat /etc/apt/sources.list.d/docker.list
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable

You can install docker using one simple command:

curl -fsSL https://get.docker.com | sh

Works not only on ubuntu but on all platforms supported by docker (kinda)