Docker rootless mode runs the Docker daemon and every container it starts as an ordinary Linux user. If someone exploits a daemon or runtime bug, they land in an unprivileged account and have to work for anything more. This guide covers the one-time prerequisites, the official setup tool, verification, systemd autostart, and the limits you’ll hit on a real server.
The short version: install uidmap and docker-ce-rootless-extras, and confirm your user has at least 65,536 subordinate UIDs and GIDs. Log in as that user directly (not through sudo su). Then run dockerd-rootless-setuptool.sh install without sudo, and enable lingering so the daemon survives reboots. You give up privileged ports by default, overlay networks, SCTP, AppArmor confinement, and checkpointing. Resource limits work only with cgroup v2 plus systemd.
Quick Reference: Docker Rootless Mode at a Glance
| Task or Symptom | What to Do |
|---|---|
| Prepare the host | Install uidmap, dbus-user-session, and docker-ce-rootless-extras |
| Check ID ranges | grep "^$(whoami):" /etc/subuid /etc/subgid should show a count of 65536 or more |
| Install | Run dockerd-rootless-setuptool.sh install as the target user, never with sudo |
| Verify | docker info lists rootless under Security Options |
| Autostart after reboot | systemctl --user enable docker plus sudo loginctl enable-linger USERNAME |
| Can’t bind port 80/443 | Publish on a high port behind a reverse proxy (recommended); granting CAP_NET_BIND_SERVICE to rootlesskit directly is a fragile last resort |
--memory / --cpus ignored | Requires cgroup v2 and a systemd-managed daemon |
systemctl --user fails | Log in through SSH or machinectl, not sudo su; install dbus-user-session |
| User namespace errors on Ubuntu 24.04+ | Install from Docker’s apt repository; Ubuntu’s apparmor package bundles the rootlesskit profile for that path |
What Is Docker Rootless Mode?
In a standard (“rootful”) install, dockerd runs as root. Anyone who can reach /var/run/docker.sock can effectively control the host. A container escape lands an attacker next to a root-owned daemon.
Rootless mode runs the daemon, containerd, and your containers inside a user namespace owned by a normal account. Inside the namespace, processes see themselves as UID 0. On the real host, container root maps to your user’s UID. Other container UIDs map into a block of subordinate IDs from /etc/subuid and /etc/subgid. A helper called RootlessKit sets up that namespace and handles networking and port forwarding.
Rootless mode is a Docker Engine feature on Linux. You set it up with Linux packages, the CLI, and systemd. On Windows or macOS you would only meet it inside a Linux VM or Linux-based backend, never as a host-side setting. Docker Engine is open source under the Apache License 2.0, and rootless mode costs nothing extra (Docker Engine overview).
The Threat Model: What Rootless Protects Against
Be clear about what you’re buying. Rootless mode reduces the blast radius of certain failures.
It helps with:
- Daemon and runtime vulnerabilities. A CVE in
dockerd,containerd, orruncthat leads to code execution gives the attacker your unprivileged user, not root. - Container escapes. A process that breaks out of a container still lacks root privileges on the host.
- Socket abuse. The rootless socket lives at
$XDG_RUNTIME_DIR/docker.sockand belongs to one user. Access to it equals access to that user, not to the whole machine. - Least-privilege audits. You can show that container workloads don’t need a root daemon.
It does not help with:
- Kernel vulnerabilities. Containers still share the host kernel. Rootless mode also depends on unprivileged user namespaces, which expose more kernel code to unprivileged users. That trade-off is why Ubuntu restricts the feature by default (covered below).
- Everything the user can touch. A compromised container that escapes as
dockerusercan read and modify anythingdockeruserowns. That includes other containers’ volumes under~/.local/share/dockerand that user’s SSH keys. - Malicious images doing their job. An image that steals data from a mounted volume still works fine in rootless mode. So does one that mines crypto inside its own limits.
- Exposed services. A vulnerable web app published on a port is just as reachable as before. Firewalling and patching are still your job.
Use a dedicated service account for rootless Docker, not your personal login. That keeps the “everything the user can touch” category small.
Rootless vs. Other Non-Root Options
| Option | Daemon runs as | What it really gives you |
|---|---|---|
Adding a user to the docker group | root | Convenience only. Group members can control a root daemon, so this is effectively root access |
userns-remap | root | Container UIDs map to unprivileged host ranges, but the daemon itself stays root |
| Rootless mode | Unprivileged user | Daemon and containers both unprivileged; the most isolation of the three, with the most limitations |
| Podman (rootless by default) | No daemon | Similar user-namespace model with a daemonless architecture and different CLI compatibility trade-offs |
| VMs / microVMs | Hypervisor | Stronger isolation boundary at higher resource cost |
Prerequisites
This guide uses commands for Ubuntu 24.04 LTS and Debian 12, with notes for RHEL-family distros where they differ. Docs were retrieved on October 31, 2026.
Engine ships frequent point releases, so check the Docker Engine 29 release notes for the current patch and RootlessKit version before you start.
- A Linux server with systemd (bare metal, VM, VPS, or a homelab mini PC)
- Docker Engine installed from Docker’s official package repository (install docs)
sudoaccess for the one-time prerequisite steps- A non-root account that will own the rootless daemon (this guide uses
dockeruser) - The ability to log in as that account directly over SSH
newuidmapandnewgidmap(from theuidmappackage)- At least 65,536 subordinate UIDs and GIDs for that account
- cgroup v2 if you need
--memory,--cpus, or--pids-limit
| Requirement | Details |
|---|---|
| OS | Linux with user namespace support; Ubuntu 24.04+ needs an AppArmor profile for rootlesskit (bundled with Ubuntu’s apparmor package when you use the .deb install) |
| Init system | systemd, for systemctl --user management and for resource limits |
| Packages | uidmap, dbus-user-session (Debian/Ubuntu) or dbus-daemon (Fedora/RHEL), docker-ce-rootless-extras |
| Subordinate IDs | 65,536 or more entries in /etc/subuid and /etc/subgid |
| Storage driver | overlay2 on modern kernels; fuse-overlayfs as a fallback on older kernels (package required); btrfs or vfs otherwise |
| Architecture | s390x isn’t supported by the static-package rootless install method |
Warning: Every step that touches packages,
/etc/subuid, or system services needssudo. The actual rootless install in Step 6 must not use sudo. Watch which account you’re running each command as.
Step-by-Step Guide
Steps 1–5 are one-time host preparation. Steps 6–11 cover the install, verification, and persistence.
Step 1: Create a Dedicated User and Log In Correctly
Create a service account for rootless Docker. Run this from your admin account:
sudo adduser dockeruser
Depending on your distribution, its account tooling, and its configuration, this may or may not assign a subordinate ID range automatically. Don’t assume it did. You’ll check /etc/subuid and /etc/subgid in Step 3 and add a range if one is missing.
Now log in as that user directly. RootlessKit needs a real systemd user session and D-Bus session. Switching with sudo su - dockeruser doesn’t create one, and the setup tool will fail to detect systemd.
# From your workstation: log in to the server as the new user
ssh dockeruser@your-server
Can’t SSH as that user? Docker’s troubleshooting docs point to machinectl from the systemd-container package. On a typical systemd host it opens a session through pam_systemd, but results depend on your PAM and user-manager configuration, so verify the session with the checks below:
# Run from your admin account on the server
sudo apt-get install -y systemd-container
sudo machinectl shell dockeruser@
Confirm the session has a runtime directory:
echo "$XDG_RUNTIME_DIR"
Expected output (the number is the user’s UID):
/run/user/1001
If this prints nothing, you’re not in a proper login session. Fix that before going further.
Step 2: Install the Required Packages
Run this from your admin account (the one with sudo), not as dockeruser:
# uidmap provides newuidmap/newgidmap
# dbus-user-session provides the per-user D-Bus that systemd --user needs
# docker-ce-rootless-extras provides dockerd-rootless-setuptool.sh and RootlessKit
sudo apt-get update
sudo apt-get install -y uidmap dbus-user-session docker-ce-rootless-extras
Confirm the helpers exist:
which newuidmap newgidmap dockerd-rootless-setuptool.sh
Expected output:
/usr/bin/newuidmap
/usr/bin/newgidmap
/usr/bin/dockerd-rootless-setuptool.sh
RHEL, Fedora, and similar: install dbus-daemon instead of dbus-user-session. On RHEL 8-like systems, also install fuse-overlayfs. RHEL 9-like systems don’t need it.
Ubuntu 24.04 and later: Ubuntu restricts unprivileged user namespaces by default. Rootless Docker needs an AppArmor profile that lets RootlessKit create one. When you install docker-ce-rootless-extras from Docker’s .deb packages, Docker’s troubleshooting docs say the rootlesskit profile is already bundled with Ubuntu’s apparmor package. If the profile seems missing, check that apparmor is installed and current, not just the Docker package.
Used Docker’s standalone rootless install script instead? Then you must create the profile yourself. Use the exact profile in Docker’s troubleshooting docs, not one copied from a forum.
Tip: Since you just installed
dbus-user-session, log out of thedockerusersession and log back in. The per-user D-Bus only starts at login.
Step 3: Verify Subordinate UID and GID Ranges
As dockeruser, check the ranges:
grep "^$(whoami):" /etc/subuid
grep "^$(whoami):" /etc/subgid
Expected output pattern (your start number will differ):
dockeruser:231072:65536
dockeruser:231072:65536
The format is user:start:count. The count must be at least 65536. The start value is just an example, so don’t copy someone else’s numbers.
If either command prints nothing, add a range from your admin account. Pick a block that doesn’t overlap any existing entry in those files:
# Check existing ranges first so you don't overlap
cat /etc/subuid /etc/subgid
# Assign 65,536 IDs starting at 300000 (adjust to avoid overlaps)
sudo usermod --add-subuids 300000-365535 --add-subgids 300000-365535 dockeruser
Then re-run the grep commands as dockeruser to confirm.
Step 4: Check cgroup v2 and the systemd User Session
Resource limits in rootless mode only work with cgroup v2 and systemd together. Without both, --memory and --cpus won’t take effect. Check now rather than finding out mid-deploy.
cat /sys/fs/cgroup/cgroup.controllers
If the file exists, you’re on cgroup v2. Expected output looks like:
cpuset cpu io memory hugetlb pids rdma misc
A “No such file or directory” error means the host uses cgroup v1. Rootless Docker will still run, but resource limits won’t apply. Most current mainstream Linux distributions default to cgroup v2, but confirm with the command above instead of assuming based on your distro version.
Next, confirm your user’s systemd instance is running:
systemctl --user status
You should see a tree with State: running. If you get Failed to connect to bus, go back to Step 1 and log in through SSH or machinectl.
Step 5: Disable the System-Wide (Rootful) Docker Daemon
If rootful Docker is running, the setup tool will complain. Disable it from your admin account:
Warning: This stops every container running under the rootful daemon. Those containers, images, and volumes stay in
/var/lib/docker, but the rootless daemon won’t see them. Migrate or recreate them first if they matter.
sudo systemctl disable --now docker.service docker.socket
Verify it’s stopped:
systemctl is-active docker.service
Expected output:
inactive
You shouldn’t need to remove /var/run/docker.sock by hand. Disabling docker.socket stops systemd from recreating it, and the file itself isn’t what’s keeping the rootful daemon alive.
If the socket file is still present and causing confusion, check systemctl is-active docker.socket and ls -l /var/run/docker.sock before touching it. The socket could belong to a different service, so confirm what owns it rather than deleting it outright.
If you need both daemons side by side for a while, the setup tool has a --force option. Most servers are simpler with one daemon.
Step 6: Run the Rootless Setup Tool
Back in the dockeruser session, run the installer:
Warning: Do not run this with
sudo. The tool creates a systemd user service and a CLI context for the current account. Running it as root defeats the purpose.
dockerd-rootless-setuptool.sh install
Expected output (abbreviated; paths reflect your username and UID):
[INFO] Creating /home/dockeruser/.config/systemd/user/docker.service
...
[INFO] Installed docker.service successfully.
[INFO] To control docker.service, run: `systemctl --user (start|stop|restart) docker.service`
[INFO] To run docker.service on system startup, run: `sudo loginctl enable-linger dockeruser`
[INFO] Creating CLI context "rootless"
Successfully created context "rootless"
...
[INFO] Make sure the following environment variable(s) are set (or add them to ~/.bashrc):
export PATH=/usr/bin:$PATH
If a prerequisite is missing, the tool stops and prints what to fix. The usual suspects are a missing uidmap, missing subuid entries, or no systemd user session. Fix the issue and run it again.
Step 7: Set the Environment and Switch the CLI Context
The tool prints the environment variables it wants, and the exact list varies by install method. On a standard apt install the binaries are already in /usr/bin, so the PATH line is harmless but usually redundant. It matters mainly for script installs that put binaries in ~/bin. Add what the tool printed to ~/.bashrc for interactive shells:
# ~/.bashrc (append these lines)
export PATH=/usr/bin:$PATH
# Points tools that don't understand Docker contexts at the rootless socket
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock
Reload your shell:
source ~/.bashrc
~/.bashrc is only read by interactive Bash shells. Services, cron jobs, and CI runners need the variable set in their own environment or config. Client behavior varies: some SDKs and tools honor Docker contexts, others read only DOCKER_HOST or their own endpoint setting, so check each tool’s documentation. The docker CLI itself uses contexts. List them and make sure rootless is active:
docker context ls
docker context use rootless
Expected output from docker context ls (the asterisk marks the active context):
NAME DESCRIPTION DOCKER ENDPOINT
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock
rootless * Rootless mode unix:///run/user/1001/docker.sock
Your column layout may differ a bit between CLI versions. What matters is that the endpoint points at /run/user/<UID>/docker.sock.
Step 8: Verify the Daemon Is Really Rootless
This step proves the setup worked. Run:
docker info
Look for sections like these in the output (other lines omitted). This is example output; ordering, the listed security options, and the storage driver vary with Engine version, kernel, distribution, and configuration:
Security Options:
seccomp
Profile: builtin
rootless
cgroupns
...
Cgroup Driver: systemd
Cgroup Version: 2
...
Docker Root Dir: /home/dockeruser/.local/share/docker
The key checks are below. Only the first two are required to confirm rootless mode:
rootlessappears under Security Options.- Docker Root Dir is inside the user’s home, not
/var/lib/docker. - With a working systemd and cgroup v2 setup, Cgroup Version shows
2. This one confirms resource limits will work, not rootless mode itself.
For a one-line check in scripts:
docker info --format '{{.SecurityOptions}}'
The output should include name=rootless; the other entries vary by host:
[name=seccomp,profile=builtin name=rootless name=cgroupns]
Step 9: Run a Test Container and Check Process Ownership
Run the standard smoke test:
# --rm removes the container after it exits
docker run --rm hello-world
You should see Hello from Docker!.
Now check what “rootless” means on the host. Start a long-running container:
# -d runs detached; the container just sleeps for 5 minutes
docker run -d --name rootless-test alpine sleep 300
Check the user ID inside the container:
docker exec rootless-test id
Expected output:
uid=0(root) gid=0(root) groups=0(root),...
Inside the namespace, the process is root. Now look at the same process from the host:
ps -o user,pid,cmd -C sleep
Expected output:
USER PID CMD
dockeruser 4821 sleep 300
Container root is dockeruser on the host. That’s the whole point, and it’s nice to see it with your own eyes. Clean up:
docker rm -f rootless-test
Step 10: Enable Autostart and Lingering
By default, a user’s systemd services stop when that user logs out. They don’t start again until the next login. On a server, you want the daemon running at boot with nobody logged in.
As dockeruser, enable the user service:
systemctl --user enable docker
Then, from your admin account, enable lingering for the user:
# Linger keeps dockeruser's systemd instance running without an active login
sudo loginctl enable-linger dockeruser
Confirm lingering is on:
loginctl show-user dockeruser --property=Linger
Expected output:
Linger=yes
Back as dockeruser, check the service:
systemctl --user status docker
Expected output (abbreviated):
● docker.service - Docker Application Container Engine (Rootless)
Loaded: loaded (/home/dockeruser/.config/systemd/user/docker.service; enabled; preset: enabled)
Active: active (running) since Sat 2026-10-31 10:14:02 UTC; 3min ago
Docs: https://docs.docker.com/go/rootless/
Main PID: 2211 (rootlesskit)
Note the main PID belongs to rootlesskit. RootlessKit is the parent that creates the namespace and launches dockerd inside it.
Day-to-day control uses the same --user flag:
systemctl --user restart docker
systemctl --user stop docker
journalctl --user -u docker --since "10 minutes ago"
Step 11: Reboot and Confirm Persistence
Warning: Rebooting interrupts every service on the host. Schedule it if anything else runs on this box.
sudo reboot
After the server comes back, SSH in as dockeruser and check:
systemctl --user is-active docker
docker info --format '{{.SecurityOptions}}'
Expected output:
active
[name=seccomp,profile=builtin name=rootless name=cgroupns]
For containers to come back too, start them with a restart policy such as --restart unless-stopped. Rootless mode doesn’t change that behavior. The policy only applies while the daemon runs, and lingering now keeps it running.
Configuration
Where Rootless Docker Keeps Its Files
| Item | Rootless location | Rootful equivalent |
|---|---|---|
| Socket | $XDG_RUNTIME_DIR/docker.sock (e.g., /run/user/1001/docker.sock) | /var/run/docker.sock |
| Data directory | ~/.local/share/docker | /var/lib/docker |
| Daemon config | ~/.config/docker/daemon.json | /etc/docker/daemon.json |
| CLI config | ~/.docker | ~/.docker |
| systemd unit | ~/.config/systemd/user/docker.service | /lib/systemd/system/docker.service |
The data directory sits in the user’s home, so plan disk space for it. If /home is a small partition, image pulls fill it fast. A dedicated SSD for container data is worth a look. NFS isn’t supported as the rootless data-root, though, so keep the data directory on local storage.
Storage Drivers
| Driver | Requirement |
|---|---|
overlay2 | Works on modern Linux kernels; preferred where available |
fuse-overlayfs | Works on older kernels with the fuse-overlayfs package installed; needed on RHEL 8-like systems |
btrfs | Needs a btrfs filesystem, ideally mounted with user_subvol_rm_allowed |
vfs | Works everywhere, but slow and disk-hungry; last resort |
Check your kernel with uname -r and the active driver with docker info --format '{{.Driver}}'.
Environment Variables
| Variable | Purpose |
|---|---|
DOCKER_HOST | Points tools that don’t read Docker contexts at the rootless socket |
PATH | Must include /usr/bin so the rootless helper binaries are found |
DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER | Selects RootlessKit’s port-forwarding driver; set in the user service environment |
Per the Engine 29 release notes, rootless networking changed during the 29.x series. Engine 29.0.0 made dockerd-rootless.sh fall back to pasta when slirp4netns isn’t installed. Engine 29.5.0 made gvisor-tap-vsock the default rootless network driver, and Docker’s packages stopped installing slirp4netns. Engine 29.8.0 updated RootlessKit to v3.1.0, adding an IPv4-only pesto port driver (DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=pesto, requires pasta). Check the notes for your exact installed version before you change driver settings.
For advanced RootlessKit configuration, including driver overrides, use Docker’s rootless tips page as the source of truth.
Known Limitations: What Won’t Work in Rootless Mode
These come from Docker’s rootless troubleshooting documentation. They’re design constraints, so plan around them up front.
| Limitation | Impact | Workaround |
|---|---|---|
| AppArmor confinement of containers | Containers can’t use AppArmor profiles | Use rootful Docker or a VM if you need it |
| Checkpoint/restore | docker checkpoint isn’t available | None in rootless mode |
| Overlay networks | No multi-host Swarm overlay networking | Rootful Docker or a different orchestrator |
| SCTP port publishing | Can’t expose SCTP ports | Rootful Docker |
| Privileged ports (<1024) | Can’t bind 80/443 by default | High port + reverse proxy (recommended); see Tips for the fragile capability-based alternative |
| Resource limits | Ignored without cgroup v2 + systemd | Run on a cgroup v2, systemd host |
ping | Often fails by default | Set net.ipv4.ping_group_range |
| Source IP propagation | Containers may not see real client IPs by default | See the official tips/troubleshooting docs |
Container IPs and --net=host | Namespaced inside RootlessKit’s network namespace | Address containers via published ports |
That last row trips people up. The IPAddress in docker inspect lives inside RootlessKit’s namespace, so you can’t reach it from the host directly. And --net=host hands the container RootlessKit’s namespace, which is separate from the real host network.
Tips and Troubleshooting
Can’t bind to port 80 or 443
Error: Something like cannot expose privileged port 80 when running docker run -p 80:80.
Why it happens: Binding ports below 1024 normally requires root, and the rootless daemon isn’t root.
Fix (recommended): Publish on a high port and put a reverse proxy in front. This is the approach the rest of this guide assumes, and it avoids touching system binaries or capabilities entirely.
# -p 8080:80 maps host port 8080 to container port 80
docker run -d --name web -p 8080:80 nginx
Then point your reverse proxy or firewall rule at port 8080.
If you absolutely need the daemon itself to bind a low port, some setups grant CAP_NET_BIND_SERVICE directly to the RootlessKit binary. Treat this as a last resort rather than a standard step. Docker doesn’t document it as a guaranteed-supported configuration for every Engine and RootlessKit version, and the exact outcome depends on your distribution’s package layout.
If you go this route anyway, confirm the real binary path first by running which rootlesskit as dockeruser, since root’s PATH can point somewhere different. Understand that the capability applies to every user on the host who can execute that binary, not just dockeruser, which widens the privilege beyond your service account.
Package upgrades typically replace the RootlessKit binary outright, which silently drops the capability. Re-check with getcap $(which rootlesskit) after any Docker update and reapply the setcap command if it’s missing.
# Run from your admin account; verify the path first
sudo setcap cap_net_bind_service=ep $(which rootlesskit)
# Run as dockeruser
systemctl --user restart docker
Prefer the reverse-proxy approach whenever you can. It carries no upgrade fragility, no system-wide capability grant, and no dependency on the specifics of your package build.
--memory or --cpus limits don’t take effect
Why it happens: Rootless cgroup limiting needs both cgroup v2 and a daemon managed by systemd. Without both, the limits don’t apply.
Fix:
- Confirm cgroup v2:
cat /sys/fs/cgroup/cgroup.controllersmust exist. - Confirm
docker infoshowsCgroup Driver: systemdandCgroup Version: 2. - Confirm the daemon runs as a
systemctl --userservice, not launched by hand.
If memory limits work but CPU limits don’t, the CPU controller may not be delegated to your user session. Docker’s troubleshooting page covers how to enable controller delegation. Older or non-systemd distributions may not support rootless limits at all.
systemctl --user fails with “Failed to connect to bus”
Why it happens: RootlessKit can’t detect systemd when you switched users with sudo su, or when no D-Bus user session exists.
Fix:
- Install
dbus-user-session(Debian/Ubuntu) ordbus-daemon(Fedora/RHEL). - Log out completely.
- Log back in through SSH as the target user, or use
sudo machinectl shell dockeruser@. - Confirm with
echo "$XDG_RUNTIME_DIR"andsystemctl --user status.
Setup tool complains about newuidmap or subuid
Why it happens: uidmap isn’t installed, or /etc/subuid and /etc/subgid don’t list at least 65,536 IDs for the user.
Fix: Install the package from your admin account:
sudo apt-get install -y uidmap
Then redo Step 3. The setup tool prints specific guidance when a prerequisite is missing, so read its output before guessing.
“Can’t create user namespace” on Ubuntu 24.04+
Why it happens: Ubuntu 24.04 and later block unprivileged user namespace creation unless an AppArmor profile allows it for the binary.
Fix: Check whether the restriction is active:
sysctl kernel.apparmor_restrict_unprivileged_userns
A value of 1 means it’s enforced. Don’t turn it off globally, since that weakens security for the whole host. Install rootless Docker from the docker-ce-rootless-extras .deb instead, which ships the needed profile. If you used the standalone install script, create the RootlessKit profile exactly as shown in Docker’s troubleshooting docs. Then restart the apparmor service.
ping doesn’t work in containers
Why it happens: Many distributions don’t let unprivileged users create ICMP echo sockets.
Fix: From your admin account, add the setting and reload sysctl:
# /etc/sysctl.d/99-rootless-ping.conf
net.ipv4.ping_group_range = 0 2147483647
sudo sysctl --system
Storage driver fails to initialize
Why it happens: Your kernel doesn’t support the selected driver, or fuse-overlayfs is missing.
Fix: Check uname -r to see your kernel version. Use overlay2 on modern kernels. On older kernels, install fuse-overlayfs and restart with systemctl --user restart docker. The storage driver table above lists the other options.
Apps behind published ports see the wrong client IP
Why it happens: RootlessKit’s port forwarding doesn’t pass the original source IP by default. Your logs, rate limiters, and allowlists see an internal address instead.
Fix: Follow the steps in Docker’s rootless tips and troubleshooting docs for your Engine version. The relevant port and network drivers changed during 29.x, so older blog posts may give stale commands.
More Practical Tips
- Keep one admin account and one service account. Do sudo work as your admin user and Docker work as
dockeruser. It keeps the threat model honest. - Power protection matters more with linger. Containers now start on their own at boot. A UPS with clean-shutdown support prevents half-written volumes after a power cut.
- Docker Compose works normally.
docker composetalks to whatever context is active. Existing compose files run as long as they avoid privileged ports and unsupported features. - Low-power hardware is fine. Rootless mode runs on any Linux box with systemd, from a Raspberry Pi 5 running a 64-bit OS to an Intel N100 mini PC.
FAQ
Is rootless mode the same as adding my user to the docker group?
No. The docker group lets you talk to a root daemon without typing sudo. That’s effectively root access. Rootless mode runs the daemon itself as your user.
Is rootless mode the same as userns-remap?
No. userns-remap remaps container UIDs, but the daemon still runs as root. Rootless mode removes root from both the daemon and the containers.
Can I use rootless mode with Docker Desktop? Rootless mode is a Docker Engine feature for Linux. Current Docker docs don’t describe a Docker Desktop toggle for it.
Can multiple users run rootless Docker on one server? Yes. Each user gets their own daemon, socket, and data directory. Each one needs a non-overlapping subordinate ID range.
Wrapping Up
You now have a Docker daemon that runs as an unprivileged service account, starts at boot without a login, and shows rootless in docker info. Container root maps to dockeruser on the host, so a daemon bug or container escape doesn’t hand over the machine.
I’d use rootless mode for most single-host homelab and self-hosted setups, since the port and resource-limit issues have clean fixes. Skip it if you need Swarm overlay networks, SCTP, AppArmor-confined containers, or checkpointing. You still need kernel patching, a firewall, and a VM for untrusted code. A good next step is a reverse proxy in front of your high-port services.
| Step | Action | Applies To |
|---|---|---|
| 1 | Create dockeruser, log in via SSH or machinectl | All distros |
| 2 | Install uidmap, D-Bus user session, docker-ce-rootless-extras | Debian/Ubuntu (RHEL: dbus-daemon, fuse-overlayfs on 8-like) |
| 3 | Verify 65,536+ subuid/subgid entries | All distros |
| 4 | Check cgroup v2 and systemctl --user | Needed for resource limits |
| 5 | Disable rootful docker.service and docker.socket | Hosts with rootful Docker installed |
| 6 | Run dockerd-rootless-setuptool.sh install without sudo | All distros |
| 7 | Set PATH/DOCKER_HOST, use the rootless context | All distros |
| 8–9 | Verify with docker info and ps | All distros |
| 10–11 | systemctl --user enable docker, loginctl enable-linger, reboot test | systemd hosts |
Resources
- Docker Docs: Rootless mode
- Docker Docs: Rootless mode troubleshooting
- Docker Docs: Rootless mode tips
- Docker Engine version 29 release notes
- Docker Engine overview and licensing