Rootless docker



  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

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" >> ~/.bashrc

echo "export DOCKER_HOST=unix:///run/user/\$(id -u)/docker.sock" >> ~/.bashrc

Docker Installation

curl -fsSL | sh

Installing docker compose

DOCKER_COMPOSE_VER=$(curl --silent | 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${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 ๐ŸŽ‰ !

But here are some common problems

Network slow

For this you can refer toย

Using privileged ports aka <1024

#### Login to user having sudo access ####

cp -v /etc/sysctl.conf /tmp/sys.conf
echo "net.ipv4.ip_unprivileged_port_start=0" >> /tmp/sys.conf

sudo mv -v /tmp/sys.conf /etc/sysctl.conf

sudo sysctl --system


Leave a Reply

Your email address will not be published. Required fields are marked *