In this guide, we’ll walk through the process of installing Docker on our AWS Lightsail instance. This is an essential step for building and managing container images. For additional details, you can refer to the Docker’s official installation guide for Ubuntu.
The Docker package available in the default Ubuntu repository might not be the latest version. To ensure we install the most up-to-date version, we’ll set up Docker’s official repository and install from there. This process includes adding a new package source, the GPG key from Docker to verify the integrity of the packages, and then the installation of the Docker package itself.
Begin by updating the list of packages:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
sudo docker run hello-world