install docker linux sits at poor average position in Search Console — readers want the shortest correct path on **Ubuntu/Debian** before Compose and stacks. Full multi-distro guide: Docker on AlmaLinux & Ubuntu.
Remove distro packages
Old docker.io or conflicting packages break the official repo.
bashubuntu
sudo apt remove -y docker docker-engine docker.io containerd runc 2>/dev/null; true

Add Docker apt repo
Use Docker’s convenience script or manual keyring on Ubuntu/Debian.
bashinstall
curl -fsSL https://get.docker.com | sudo sh

Enable and test
Start daemon and run hello-world.
bashtest
sudo systemctl enable --now docker
docker run --rm hello-world

Non-root access
Add your user to the docker group (log out/in).
WarningThe docker socket is root-equivalent — only trusted users belong in the group.

Quick Reference
- AlmaLinux/Rocky: full install guide
- Compose: Docker Compose
Related tutorials
Diagrams are original illustrations by Gnome IT Solutions. Tutorial text © Gnome IT Solutions.