Install Docker CE on Ubuntu 18.04.2 LTS

Introduction

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.

Installation

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 \
software-properties-common

	

Then I added Dockers GP key with curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

I set up the repository for smd 64bit with

sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"

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

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

It seems everyting 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.

Quick Links

Docker Install Guide Docker Post Installation Getting Started Guide