Install Docker CE on Ubuntu 18.04.2 LTS


I've decided to spin up a new VM to see what all the fuss abut Docker is about. I'll be following the guide on the official docker docs website which I will link to at the bottom of the post.

I'm going to set it up using repositories so that it will be easier to update in the future.


First i updated the package index and installed the ability to use repositories over https:

sudo apt-get update

sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \

Then I added Dockers GP key with curl -fsSL | sudo apt-key add -

I set up the repository for amd 64bit with

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

Run a package update again and then use sudo apt-get install docker-ce docker-ce-cli to install docker

Then to test that it was working I ran sudo docker run hello-world

It seems everything was installed correctly so I'm going to move on to some post install

Post Installation

To enable Docker to start on boot I'll simply run sudo systemctl enable docker

I'll also add docker as a user and group so that it can be accesses more easily from a non root-user account

First sudo groupadd docker
Then sudo usermod -aG docker $USER

You should be able to run commands without sudo now.

Docker Install Guide
Docker Post Installation
Getting Started Guide