OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
apps-services high very-common DISPUTE

Fix "Cannot connect to the Docker daemon" / permission denied on docker.sock

archomarchyendeavouroscachyosmanjarodockerdesktoplaptop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

Correct for plain Arch (packages docker, docker-buildx, docker-compose all exist, and the newgrp caveat and the 'docker group == root' warning are right). It is wrong for Omarchy 4, which is in applies_to: install/config/docker.sh in v4.0.1 documents that Quattro deliberately does NOT add the install user to the docker group ('membership in the docker group is equivalent to passwordless root'), and ships omarchy-sudo-docker plus an opt-in toggle. Pasting usermod -aG docker $USER silently undoes a shipped hardening decision instead of using the supported path. Also, Omarchy enables docker.socket only, not docker.service (see enable-services.sh), so enable --now docker.service there has the side effect covered by the sibling record.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.
RISK

Anyone in the docker group is effectively root: docker run --privileged -v /:/host ... gives full access to the host filesystem. Do not add untrusted users. Also note the daemon can fail to start while a VPN is connected because of IP conflicts with Docker's bridge/overlay networks. Disconnect the VPN, start Docker, reconnect.

Symptom

Running docker ps prints:


Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

or


permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

It works with sudo docker ps.

Cause

Two separate causes with the same symptom: the daemon is not started/enabled at all, or your user is not in the docker group so it cannot open the root-owned socket.

Fix

On plain Arch/EndeavourOS/CachyOS the fix as written is right (sudo pacman -S docker docker-buildx docker-compose, sudo systemctl enable --now docker.service, sudo usermod -aG docker $USER, then log out and back in).

On **Omarchy 4 (Quattro)** do not add yourself to the docker group by hand. Quattro intentionally leaves that group empty because it is passwordless root. Either keep using the packaged wrappers (omarchy-sudo-docker ..., the Docker TUI via Super+Shift+D, or plain sudo docker ...), or opt in explicitly, behind the warning, with:


omarchy-setup-security-sudoless-docker   # Setup > Security > Sudoless Docker

(and omarchy-remove-security-sudoless-docker to undo it). Diagnostics (systemctl status docker.service, journalctl -u docker.service -b --no-pager) and the VPN/IP-conflict note are correct as written.

Verify

docker info succeeds without sudo and docker run --rm archlinux bash -c "echo hello world" prints hello world. id -nG includes docker.

Sources

docker-cannot-connect-to-daemon