Check if Docker is rootless
ps aux | grep dockerd
If rootless, dockerd runs under your user, not root.
Install rootless Docker
Prerequisites (Ubuntu/Debian):
Install and setup:
sudo systemctl disable --now docker.service docker.socket
# Install rootless Docker
curl -fsSL https://get.docker.com/rootless | sh
# Enable auto-start
systemctl --user enable docker
sudo loginctl enable-linger $(whoami)
Add to shell profile:
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock
Verify
docker run --rm hello-world
Security Impact
Even if containers are compromised, attackers cannot gain root access to your host system. This fundamentally improves your security posture.
Complete Documentation
For detailed installation instructions, troubleshooting, and configuration options, see: Docker Rootless Documentation