Skip to content

Instantly share code, notes, and snippets.

@jmkim
Last active August 13, 2025 18:56
Show Gist options
  • Save jmkim/7b01ae56f9d9d941f6177cce54360e32 to your computer and use it in GitHub Desktop.
Save jmkim/7b01ae56f9d9d941f6177cce54360e32 to your computer and use it in GitHub Desktop.
Unprivileged Docker Installation and Configuration

Installation commands:

sudo apt install dbus-user-session fuse-overlayfs slirp4netns uidmap docker-ce-rootless-extras
sudo systemctl disable --now docker.service docker.socket
sudo rm /var/run/docker.sock
echo 'export DOCKER_HOST="unix:///run/user/$(id -u)/docker.sock"' >> ~/.bashrc
sudo modprobe nf_tables
dockerd-rootless-setuptool.sh install
sudo loginctl enable-linger $(whoami)

Shell rc (e.g. ~/.bashrc or ~/.zshrc):

# Docker rootless
export DOCKER_HOST="unix:///run/user/$(id -u)/docker.sock"

Ref: https://docs.docker.com/engine/security/rootless/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment