Install Docker Engine on Ubuntu 20.04 Core LTS - cfloquetprojects/homelab GitHub Wiki

Introduction

Docker is an immensely popular platform as a service (PaaS) product that essentially delivers OS-level virtualization to run software or apps within containers for high scalability and isolation/security.

Resources

Pre-Flight Check:

  • Ensure you have an properly patched, updated, and networked Ubuntu 20.04 LTS Core host.

Begin Docker Installation on Ubuntu v20.04:

  • Let's update the apt package index and install packages to allow apt to use a repository over HTTPS:

sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release

  • Let's add the GPG key for the official Docker repository to our system:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

  • Use the following command to set up the stable repository:
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  • Lets update once again with the new repos added:

sudo apt -y update

  • Install the latest version of Docker Engine and containerd:

sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose

  • Display the status of the docker service using this nifty one-liner:

systemctl is-active sshd >/dev/null 2>&1 && echo "SUCCESSFUL" || echo "FAILED"