Set up rootless Docker on Arch (the upstream setuptool does not exist here)
Checked on this Omarchy 4 workstation (omarchy 4.0.2-1, kernel 7.1.9-arch1-2, docker 1:29.7.2-1, shadow 4.20.0.arch1-1, systemd 261) and against all four cited sources, every one of which returns 200 and supports the claim it is cited for, so nothing is removed. Confirmed on this machine: pacman -Ql docker lists only /usr/lib/systemd/system/docker.service and docker.socket, with no dockerd-rootless.sh and no dockerd-rootless-setuptool.sh, so the command not found framing and the whole cause are right. The Arch wiki Docker page states the same in its Rootless Docker daemon note, gives the /etc/subuid and /etc/subgid 65536 form, the docker context create line with unix:///run/user/$(id -u)/docker.sock, and the lingering tip. Podman page lines 68 to 78 are the source of the usermod --add-subuids 100000-165535 command and of the warning that this is the default range for the first account. Systemd/User is the source of loginctl enable-linger and of the warning about faking autologin that the record's danger reproduces. cause and danger are correct and are left untouched. Three defects in fix, all of them generic advice that misfires on Omarchy 4. First, printf 'DOCKER_HOST=unix://%t/docker.sock' into ~/.config/environment.d/ does not work. man 5 environment.d on systemd 261 says the right hand side may reference variables using ${OTHER_KEY} and $OTHER_KEY and that no other elements of shell syntax are supported, and %t is a unit-file specifier that environment.d never sees, so DOCKER_HOST would be set to the literal string unix://%t/docker.sock. The wiki's own wording is unix://$XDG_RUNTIME_DIR/docker.sock. Second, zgrep CONFIG_USER_NS_UNPRIVILEGED /proc/config.gz returns nothing on this stock Arch kernel: zgrep -E 'CONFIG_USER_NS(_UNPRIVILEGED)?=' /proc/config.gz prints only CONFIG_USER_NS=y, because that symbol is a linux-hardened addition and is absent from mainline, so the check reads as a positive for a problem that is not there. The record's linux-hardened scoping is itself correct, confirmed from Arch's linux-hardened config.x86_64 line 270, # CONFIG_USER_NS_UNPRIVILEGED is not set, and the sibling check holds: /proc/sys/kernel/unprivileged_userns_clone does exist here and reads 1. Third, the subuid step is already done on Omarchy 4. /etc/subuid and /etc/subgid here both hold techluddite:100000:65536, and /etc/login.defs sets SUB_UID_COUNT 65536, so the record's exact suggested range is the one already taken, and man 8 usermod states that --add-subuids performs no checks against SUB_UID_MIN, SUB_UID_MAX or SUB_UID_COUNT, which means running it anyway silently appends a duplicate line. Added the Omarchy-specific point that Omarchy enables the system docker.socket and deliberately keeps the user out of the docker group, so the root daemon is always up and the context check is the load-bearing step rather than a nicety, which is also why verify now leads with docker context show. Boundary against the two neighbouring ufw records: docker-container-dns-blocked-by-ufw and docker-published-ports-bypass-ufw are both about the system daemon's bridge and its nftables chains, and neither applies to this record, because a rootless daemon reads ~/.config/docker/daemon.json rather than Omarchy's /etc/docker/daemon.json and publishes ports through rootlesskit in the user's own namespace. I did not add a claim about how ufw treats rootless published ports, because I could not verify it. Package facts rechecked: AUR docker-rootless-extras is at 29.8.0-1 with depends docker>=1:29.5.0 and rootlesskit>=3.0.0, which the installed docker satisfies, and rootlesskit is 3.1.0-1 in extra, so the record's older audit note figure of 29.7.2-1 is stale but the record body never quoted a version. NOT exercised: I have no sudo and am not in the docker group, so I could not install the AUR package, enable a user unit, create a context, or start any container. The %t failure and the merge behaviour are read from the systemd and shadow manual pages rather than observed, and the linux-hardened behaviour is read from Arch's packaged config rather than run.
Rootless Docker is a separate, empty daemon: existing images, volumes and containers under /var/lib/docker are invisible to it and are NOT migrated. It also cannot bind ports below 1024 by default and has no access to host devices. Do not run both daemons and then wonder which one docker compose down -v just wiped. Check docker context show first. Enabling lingering keeps a daemon running after logout. Do not use lingering to fake autologin, it breaks session permissions.
Symptom
Following Docker's rootless instructions fails at the first step:
bash: dockerd-rootless-setuptool.sh: command not found
or, after wiring something up by hand, docker ps still shows the root daemon's containers, or rootlesskit dies with failed to setup UID/GID map: newuidmap ... : exit status 1.
Cause
Arch's docker package does not ship upstream's dockerd-rootless.sh / dockerd-rootless-setuptool.sh wrappers. The rootless pieces live in the AUR package docker-rootless-extras, which instead provides docker.service and docker.socket as **user** units. And rootless mode needs a subordinate UID/GID range allocated to your user, which older accounts do not have.
Fix
Install the rootless extras. They depend on rootlesskit, which now lives in extra rather than the AUR, so this is one AUR build:
yay -S docker-rootless-extras
Check whether you already have a subordinate ID range before allocating one. On Omarchy 4, and on any account created by a current archinstall, useradd has already done it, because /etc/login.defs sets SUB_UID_COUNT 65536:
cat /etc/subuid /etc/subgid
grep -E 'SUB_(UID|GID)_(MIN|COUNT)' /etc/login.defs
One line per file of the form yourname:100000:65536 is everything rootless mode needs, and there is nothing more to do. Only if your user has no line, add one. usermod does no overlap checking at all, so running it when the range is already present just gives you a second duplicate line:
sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USER
Pick a free range out of /etc/subuid if 100000-165535 is taken. It is the default range for the first account on the machine, which on Omarchy is you.
Start the daemon as a user unit:
systemctl --user enable --now docker.socket
systemctl --user status docker.socket
Point the client at it with a persistent context. This matters more on Omarchy than on plain Arch, because Omarchy enables the system docker.socket at install time, so the root daemon is always running and is what an unconfigured client reaches:
docker context create rootless --description "Rootless mode" \
--docker "host=unix:///run/user/$(id -u)/docker.sock"
docker context use rootless
docker context show
docker info | grep -E 'rootless|Docker Root Dir'
Or set the environment variable instead, somewhere user units and GUI apps can see it rather than only in .bashrc. Write ${XDG_RUNTIME_DIR} and not %t: %t is a systemd unit-file specifier, and environment.d expands only $VAR and ${VAR} references, so %t would be stored as those two literal characters:
mkdir -p ~/.config/environment.d
printf 'DOCKER_HOST=unix://${XDG_RUNTIME_DIR}/docker.sock\n' > ~/.config/environment.d/60-docker-rootless.conf
That file is read when your systemd user instance starts, so it takes effect at your next login. For the shell you are in now:
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock
To have it running without an open session, so containers come back after a reboot:
loginctl enable-linger
loginctl list-users # LINGER should say yes
If rootlesskit still fails, check whether unprivileged user namespaces are blocked:
sysctl kernel.unprivileged_userns_clone
On Omarchy 4's stock linux kernel that reads 1 and user namespaces are available. Do not use zgrep CONFIG_USER_NS_UNPRIVILEGED /proc/config.gz as the test. That symbol does not exist in the mainline Arch linux config, so the grep prints nothing on a machine where rootless mode works perfectly well. It is a linux-hardened symbol, and Arch's linux-hardened config carries # CONFIG_USER_NS_UNPRIVILEGED is not set, which is the kernel where rootless mode actually fails:
uname -r
zgrep '^CONFIG_USER_NS' /proc/config.gz
Verify
docker context show says rootless, then docker info shows rootless in the security options and Docker Root Dir: /home/<you>/.local/share/docker, and docker run --rm hello-world succeeds without sudo. Check the context first: Omarchy keeps the system docker.socket enabled and leaves your user out of the docker group, so a client still pointed at the default context prints permission denied while trying to connect to the docker API at unix:///var/run/docker.sock rather than anything about rootless mode.
Sources
- https://wiki.archlinux.org/title/Docker
- https://aur.archlinux.org/packages/docker-rootless-extras
- https://wiki.archlinux.org/title/Systemd/User
- https://wiki.archlinux.org/title/Podman
- https://archlinux.org/packages/extra/x86_64/rootlesskit/json/
- https://gitlab.archlinux.org/archlinux/packaging/packages/linux-hardened/-/raw/main/config.x86_64