How to Install Docker Rootless on Ubuntu (2026 Guide)
Quick one-liner: Run Docker without sudo — safer, simpler, and no system-wide changes.
Why This Matters
I still remember the first time I saw a developer accidentally break a production server. They ran docker rm -f with a wildcard, and because Docker was running as root, it deleted system containers too. The entire server went down.
That's why I now install Docker in rootless mode by default.
Think of it like a seatbelt — you don't need it until you do. Rootless Docker means:
- Your containers can't touch system files
- No sudo required for daily operations
- Damage is contained if something goes wrong
You asked, I delivered: This guide was the #1 request in my LinkedIn poll (Ubuntu / Linux Mint won with 57% of votes).
Prerequisites
- Ubuntu 22.04 or higher (also works on Linux Mint, Pop!_OS)
- Basic terminal familiarity (copy-paste commands)
- 5 minutes of your time
Step 1: Install Dependencies
First, update your package list and install the required tools:
sudo apt update
sudo apt install -y curl ca-certificates fuse uidmap
What we're installing:
-
curl— Downloads the Docker installation script -
ca-certificates— Verifies secure connections -
fuse— Allows user-space filesystem access (needed for rootless) -
uidmap— Enables user namespace mapping (security isolation)
Step 2: Download the Rootless Docker Script
Docker provides an official installation script for rootless mode:
curl -fsSL https://get.docker.com -o get-docker.sh
Verify the download:
ls -lh get-docker.sh
You should see a file around 20-25KB in size.
Step 3: Run the Installation Script
Execute the script with the --rootless flag:
sh get-docker.sh --rootless
What happens:
- Downloads Docker binaries to
~/.docker/rootless - Sets up a user-specific systemd service
- Configures network namespaces
Expected output (last few lines):
Created symlink /etc/systemd/user/default.target.wants/docker.service → /usr/lib/systemd/user/docker.service.
Created symlink /etc/systemd/user/sockets.target.wants/docker.sock → /usr/lib/systemd/user/docker.sock.
Docker rootless mode installed successfully.
Step 4: Configure Your Shell
Add Docker to your PATH so you can run it without the full path:
echo 'export PATH=/home/$USER/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
For Zsh users:
echo 'export PATH=/home/$USER/bin:$PATH' >> ~/.zshrc
source ~/.zshrc
Step 5: Start Docker
Start the Docker daemon for your user session:
systemctl --user start docker
Enable Docker to start on login:
systemctl --user enable docker
Verification
Here's how to confirm everything worked:
1. Check Docker is running:
docker ps
Expected output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
(Empty list is fine — we're just checking the daemon responds.)
2. Verify rootless mode:
docker info | grep -i rootless
Expected output:
Rootless: true
3. Test with a container:
docker run hello-world
Expected output:
Hello from Docker!
This message shows that your installation appears to be working correctly.
Troubleshooting
Problem: "Cannot connect to the Docker daemon"
Solution: The Docker service isn't running. Start it:
systemctl --user start docker
If that fails, check the status:
systemctl --user status docker
Problem: "fuse: device not found"
Solution: Install FUSE support:
sudo apt install -y fuse
Then restart Docker:
systemctl --user restart docker
Problem: Containers can't access the network
Solution: Rootless Docker uses user namespaces, which can conflict with some network configurations. Try:
sudo sysctl -w net.ipv4.ip_unprivileged_port_start=0
To make this permanent:
echo "net.ipv4.ip_unprivileged_port_start=0" | sudo tee -a /etc/sysctl.conf
What's Next
Now that Docker is running rootless, you can:
-
Deploy your first app — Try
docker run -p 8080:80 nginx - Learn Docker Compose — Multi-container orchestration made simple
- Set up volumes — Persist your data across container restarts
Want more? I've written a full book on Docker — "Levelling Up with Docker" — with 14 chapters covering volumes, networking, Compose, and production best practices. Grab it on Amazon.
Share This Guide
Found this helpful? Share it with someone learning Docker:
- LinkedIn: Share this post
- Twitter: Tweet about it
Questions? Drop a comment below or reach out on LinkedIn.
Published: 4 March 2026
Author: David Tio
Tags: Docker, Ubuntu, Linux, Rootless, DevOps, Tutorial
Cross-posted to: Dev.to, Hashnode (canonical URL: fosstechnotes.blogspot.com)
Top comments (0)