How-to: Install Docker on Ubuntu 18.04

Installing Docker on Ubuntu 18.04 is as straightforward as executing this Bash script:


sudo apt-get update
sudo apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
curl -fsSL | sudo apt-key add -

sudo add-apt-repository \
   "deb [arch=amd64] \
   $(lsb_release -cs) \

sudo apt-get update

sudo apt-get install -y docker-ce
sudo docker run hello-world

You can copy-and-paste the script above or just run it from my Github Gist on a single command-line:

$ curl -s | bash /dev/stdin

See the official Docker documentation for the latest instructions if these instructions don't work for you.

Docker is a set of platform as a service products that uses OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels. [ref]

Explore More