Note
This guide is a copy-paste-observe list of quick instructional steps on how to set up Docker quickly without wasting any cognitive energy.
Run these commands to update your system and install prerequisite packages needed for adding Docker’s official repository and signing keys:
sudo apt-get update -y
sudo apt-get install ca-certificates curl -y
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.ascRun this command to add Docker’s official APT repository to your system sources list:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullRun these commands to refresh your package list and install Docker Engine along with CLI tools and plugins:
sudo apt-get update -y
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginRun these commands to create the Docker user group and add your current user to it so Docker can be run without sudo:
sudo groupadd docker
sudo gpasswd -a $USER dockerRun this command to reboot your system so group permissions and Docker installation changes take effect:
sudo rebootRun docker ps below and you should see something similar below in your terminal:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES