FULL AI ANALYSIS

Self-hosted GitHub Actions runner cannot access /var/run/docker.sock when launched as systemd service

Generated Oct 20, 2026, 9:41:02 AM

Analysis summary

Symptoms point to a classic systemd/user-group vs. login-session problem: adding the user to the docker group changes /etc/group but systemd does not re-evaluate supplementary groups for an existing service unless the unit config applies them. The runner process therefore lacks the docker group membership at start and cannot open the socket. A temporary chmod 666 obscures the real issue; correct fix is to configure the service unit to run with appropriate group privileges or use a socket-ownership approach. Alternate, less likely causes include filesystem namespace isolation (PrivateTmp) or ProtectSystem flags that block the path.

Possible causes

Service process started by systemd doesn't have docker group in its supplementary groups because unit lacks Groups= or SupplementaryGroups=; systemd won't pick up /etc/group changes automatically

85%

Unit uses ProtectSystem/ProtectHome/PrivateDevices or other hardening that prevents access to /var/run/docker.sock even if group membership is present

45%

Docker daemon placed socket in different mount/namespace or rootless Docker created socket owned by different user/group not matching runner expectations

20%

AppArmor/SELinux policy denies access for the service process to the socket path

15%

Suggested fixes

1

Diagnostic step 1

Inspect the runner systemd unit: sudo systemctl cat actions.runner.<name>.service and look for User=, Group=, SupplementaryGroups= and PrivateTmp/ProtectSystem/PrivateDevices flags.

2

Diagnostic step 2

If intended: add Group=docker (or SupplementaryGroups=docker) to the unit and avoid chmodding the socket. Example: set Group=docker and restart systemd daemon: sudo systemctl daemon-reload; sudo systemctl restart actions.runner.<name>.service.

3

Diagnostic step 3

If unit must retain a non-privileged group, create a minimal wrapper unit that binds the socket into the runner's namespace with a safe bind-mount: use Systemd Mount unit or ProtectedBindPaths carefully; prefer Group= approach.

4

Diagnostic step 4

If ProtectSystem/PrivateDevices present, temporarily disable those to verify effect and re-enable with adjusted settings; do not leave diminished hardening in production.

5

Diagnostic step 5

Verify by running: sudo -u ci-runner docker ps (or reproduce a workflow job) and confirm no permission errors in journalctl -u actions.runner.<name>.service. Rollback: revert Group= changes and service files if unexpected behavior appears.