- Update the package list:
sudo apt update
- Install necessary packages:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
- Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
- Set up the stable Docker repository:
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 the package list again:
sudo apt update
- Install Docker:
sudo apt install docker-ce docker-ce-cli containerd.io
- Verify Docker installation:
sudo docker --version
- Add your user to the
docker
group:
sudo usermod -aG docker $USER
- Activate the changes to the user group:
newgrp docker
- Verify Docker without
sudo
:
docker run hello-world
No comments:
Post a Comment