You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# If more information needed, head to this tutorial:
# https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04
# Firstly update your existing list of packages
sudo apt update
# Now install the prerequesites packages with apt and HTTPS
sudo apt install apt-transport-https ca-certificates curl software-properties-common
# Add the GPG key of the official Docker repository to your system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Add the Docker repository to apt sources
echo "deb [arch=$(dpkg --print-architecture) 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
# Update your existing packages again
sudo apt update
# Make sure you install Docker from the Docker repository AND NOT from the Ubuntu reposiroty
# You should see a candidate version as "version_of_docker~ubuntu-jammy"
apt-cache policy docker-ce
# Now install docker
sudo apt-get install docker.io
# Ensure docker is starting
sudo systemctl status docker
# If Docker is not started, enable docker.socket
sudo systemctl enable docker.socket
sudo systemctl start docker.socket
sudo systemctl restart docker
sudo systemctl status docker
Step 02 - Configure Docker
# Add your user to docker groups
sudo usermod -aG docker ${USER}
# alternative way to get the username
sudo usermod -aG docker $(whoami)
# Apply the new group membership
su - ${USER}
# alternative way to get the username
su - $(whoami)