curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh --dry-run
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
- Create the docker group
sudo groupadd docker
- Add your user to the docker group
sudo usermod -aG docker $USER
- Log out and log back in so that your group membership is re-evaluated
- Verify that you can run docker commands without sudo
docker run hello-world
Fix WARNING: Error loading config file: /home/user/.docker/config.json -stat /home/user/.docker/config.json: permission denied
sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
sudo chmod g+rwx "$HOME/.docker" -R
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
To stop this behavior, use disable instead
sudo systemctl disable docker.service
sudo systemctl disable containerd.service