Title: Rootless docker
Author: Immanuel Raj
Published: February 22, 2024
Last modified: November 26, 2026

---

![Social card titled Rootless Docker on Ubuntu, a DevOps guide to running Docker
and Compose without root access](https://immanuelraj.dev/wp-content/uploads/2026/
11/upload-706abc223af03c8c.avif)

# Rootless docker

[February 22, 2024](https://immanuelraj.dev/rootless-docker/)

—

by

[Immanuel Raj](https://immanuelraj.dev/author/iamimmanuelraj/)

in [Uncategorized](https://immanuelraj.dev/category/uncategorized/)

Read Time

1–2 minutes

References

 * [https://docs.docker.com/engine/security/rootless/](https://docs.docker.com/engine/security/rootless/)

## **ASSUMPTIONS**

 1. You have no docker as root installed
 2. You have no root access (Not even use apt install)
 3. You want to install rootless and systemd style docker and docker compose and all
    other plugins
 4. You have a Ubuntu system – Latest (or VM) with default kernel
 5. Your Ubuntu distribution is not cutdown version

## **Docker Root Installation Pre-Requisites**

    ```wp-block-code
    loginctl enable-linger rtcamp # It creates /run/user/$(id -u)export XDG_RUNTIME_DIR=/run/user/$(id -u)echo "export PATH=/home/rtcamp/bin:\$PATH" >> ~/.bashrcecho "export DOCKER_HOST=unix:///run/user/\$(id -u)/docker.sock" >> ~/.bashrc
    ```

## **Rootless Docker Installation**

    ```wp-block-code
    curl -fsSL https://get.docker.com/rootless | sh
    ```

## **Installing docker compose**

    ```wp-block-code
    DOCKER_COMPOSE_VER=$(curl --silent https://api.github.com/repos/docker/compose/releases | jq -r '.[0].tag_name') DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} # only for the script to run mkdir -p $DOCKER_CONFIG/cli-plugins curl -SL https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VER}/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose chmod u+x $DOCKER_CONFIG/cli-plugins/docker-compose
    ```

**It all works 🎉 !**

![Flow diagram of a rootless Docker install on Ubuntu: enable linger, set runtime
and Docker host variables, run the installer, add Compose](https://immanuelraj.dev/
wp-content/uploads/2026/11/upload-83e5116747b74f1c.avif)

Only the low-port fix needs a user with sudo; everything else runs as you.

But here are some common problems

**Network slow**

For this you can refer to [https://docs.docker.com/engine/security/rootless/#network-is-slow](https://docs.docker.com/engine/security/rootless/#network-is-slow)

**Using privileged ports aka <1024**

    ```wp-block-code
    #### Login to user having sudo access #### cp -v /etc/sysctl.conf /tmp/sys.confecho "net.ipv4.ip_unprivileged_port_start=0" >> /tmp/sys.conf sudo mv -v /tmp/sys.conf /etc/sysctl.conf sudo sysctl --system
    ```

[devops](https://immanuelraj.dev/tags/devops/) [docker](https://immanuelraj.dev/tags/docker/)
[linux](https://immanuelraj.dev/tags/linux/) [python](https://immanuelraj.dev/tags/python/)
[ubuntu](https://immanuelraj.dev/tags/ubuntu/)

[Previous:  Github Rate limits](https://immanuelraj.dev/github-rate-limits/)

[Next:  Pa11y and Pa11y-CI Accessibility testing](https://immanuelraj.dev/pa11y-and-pa11y-ci-accessibility-testing/)

![Immanuel Raj Avatar](https://secure.gravatar.com/avatar/88db6e1fa27cf854075acbaa156189ace30cf3701b2d8640cd774280ead1d4d3?
s=80&d=mm&r=g)

## About the author

Software Developer & Technology Consultant

---

## Popular Categories

 * [Bible](https://immanuelraj.dev/category/bible/) (1)
 * [Cloudflare](https://immanuelraj.dev/category/cloudflare/) (1)
 * [Databases](https://immanuelraj.dev/category/databases/) (1)
 * [Docker](https://immanuelraj.dev/category/docker/) (1)
 * [Email](https://immanuelraj.dev/category/email/) (1)
 * [ERPNext](https://immanuelraj.dev/category/erpnext/) (3)
 * [Frappe](https://immanuelraj.dev/category/frappe/) (2)
 * [Github Actins](https://immanuelraj.dev/category/github-actins/) (1)
 * [God](https://immanuelraj.dev/category/god/) (1)
 * [Google Cloud](https://immanuelraj.dev/category/gcp/) (1)
 * [Hosting](https://immanuelraj.dev/category/hosting/) (2)
 * [Life](https://immanuelraj.dev/category/life/) (1)
 * [Linux](https://immanuelraj.dev/category/linux/) (13)
 * [ML](https://immanuelraj.dev/category/ml/) (1)
 * [Networking](https://immanuelraj.dev/category/networking/) (3)
 * [Security](https://immanuelraj.dev/category/security/) (2)
 * [Self Hosting](https://immanuelraj.dev/category/self-hosting/) (7)
 * [SSL](https://immanuelraj.dev/category/ssl/) (3)
 * [Terminal](https://immanuelraj.dev/category/terminal/) (1)
 * [Tools](https://immanuelraj.dev/category/tools/) (2)
 * [Uncategorized](https://immanuelraj.dev/category/uncategorized/) (10)
 * [Web](https://immanuelraj.dev/category/web/) (3)
 * [WordPress](https://immanuelraj.dev/category/wordpress/) (1)

---

## Useful Links

Links I found useful and wanted to share.

 * [Sponsor Me](https://github.com/sponsors/iamimmanuelraj)

---

## Search the website

Search