Step 1: Update packages
sudo apt update
Step 2: Install a few prerequisite packages
sudo apt install apt-transport-https ca-certificates curl software-properties-common
Step 3: Add the GPG key for the official Docker repository
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -