dockerd-rootless-setuptool.sh refuses to install while rootful Docker is present
Your error
[ERROR] Aborting because rootful Docker (/var/run/docker.sock) is running and accessible. Set --force to ignore.Fix it fast
Most common cause, 1 of 3The system-wide Docker daemon is still running
Stop and disable the service and its socket unit, remove the socket file, and repeat the install without sudo.
sudo systemctl disable --now docker.service docker.socket
sudo rm /var/run/docker.sock
dockerd-rootless-setuptool.sh installShort answer
Aborting because rootful Docker (/var/run/docker.sock) is running and accessible comes from dockerd-rootless-setuptool.sh when your user can write to the system socket. Disable docker.service and docker.socket, remove /var/run/docker.sock, then rerun the install. To keep both daemons, pass --force and switch between them with docker context use. Docker Engine 29 on Ubuntu 24.04.
Which cause do you have?
Check the two systemd units and the socket file. Which of them is still there tells the causes apart.
systemctl is-active docker.service docker.socket
ls -l /var/run/docker.sock
test -w /var/run/docker.sock && echo "writable for $(id -un)"Then find the line you see in this list and open its fix:
- 1The system-wide Docker daemon is still running
systemctl reports docker.service as active - 2The daemon is stopped, but the socket file is still there
docker.service is inactive, yet ls still shows /var/run/docker.sock and the writable test prints a line - 3You want rootless and rootful Docker side by side
You need the system daemon for other users or services, so disabling it is not an option
What does the error look like?
[ERROR] Aborting because rootful Docker (/var/run/docker.sock) is running and accessible. Set --force to ignore.
Cause 1 of 3
The system-wide Docker daemon is still running
You seesystemctl reports docker.service as active
Check
The rootless installer aborts on rootful Docker because the normal, root-owned daemon is still up and you can reach its socket. Docker's rootless guide tells you to disable that daemon before you install, and to remove its socket file.
systemctl status docker.service --no-pagerFix
Stop and disable the service and its socket unit, remove the socket file, and repeat the install without sudo.
sudo systemctl disable --now docker.service docker.socket
sudo rm /var/run/docker.sock
dockerd-rootless-setuptool.sh installVerify
The installer ends by creating and selecting the rootless context, and docker info names it.
docker info | grep -E 'Context|rootless'Confirmed by docs.docker.com
Cause 2 of 3
The daemon is stopped, but the socket file is still there
You seedocker.service is inactive, yet ls still shows /var/run/docker.sock and the writable test prints a line
Check
The setup tool reports rootful Docker even with the daemon stopped, because its check never asks a daemon anything. In the script the abort runs whenever /var/run/docker.sock is writable for you and --force is not set, so a socket file kept by an active docker.socket unit, or one simply left behind, is enough.
systemctl is-active docker.socket; systemctl is-enabled docker.socketFix
Disable the socket unit as well, delete the file it left, and start the install again.
sudo systemctl disable --now docker.socket
sudo rm -f /var/run/docker.sock
dockerd-rootless-setuptool.sh installVerify
The writable test from the first step prints nothing, and the installer gets past the check.
test -w /var/run/docker.sock || echo 'no rootful socket'Confirmed by raw.githubusercontent.com
Cause 3 of 3
You want rootless and rootful Docker side by side
You seeYou need the system daemon for other users or services, so disabling it is not an option
Check
The abort message on rootful Docker is a guard, not a hard limit. Docker's guide says that if you keep the system service and socket you must pass --force, and that until you disable them you are still running rootful Docker as well.
dockerd-rootless-setuptool.sh --helpFix
Install with --force. The tool creates a CLI context called rootless and selects it; switch back to the system daemon with the default context whenever you need it.
dockerd-rootless-setuptool.sh install --force
docker context use rootless # your own daemon
docker context use default # the system daemonVerify
docker context ls lists both contexts, and docker info shows rootless under Security Options while the rootless context is selected.
docker context ls
docker info | grep -A6 'Security Options'Confirmed by docs.docker.com
How do I stop it coming back?
- Decide per machine whether Docker runs rootful or rootless, and disable docker.service and docker.socket on rootless-only hosts.
- Run sudo loginctl enable-linger for the rootless user, as the installer prints, so the daemon survives logout and reboot.
- Script the switch with docker context use instead of exporting DOCKER_HOST by hand.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine on the same stack: TaxiDex, Dispatch Pro.