Skip to content

Docker Install and setup on Debian/Ubuntu

Complete Docker Setup on Ubuntu/Debian

1. Update the system:

sudo apt update && sudo apt upgrade -y

2. Install Docker:

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh

3. Add user to docker group:

sudo usermod -aG docker $USER

4. Install Docker Compose:

sudo apt install docker-compose-plugin -y

5. Enable Docker service:

sudo systemctl enable docker
sudo systemctl start docker

6. Log out and back in (or restart) to apply group changes.

7. Verify installation:

docker --version
docker run hello-world

Notes

  • The group membership change requires a logout/login to take effect
  • After step 7, you should be able to run Docker commands without sudo
  • If hello-world runs successfully, Docker is properly installed and configured