From a security standpoint, running the Docker daemon as root is not recommended. Docker therefore also offers an installation option for running Docker rootless.
Under Debian 13, however, you must first add two packages, namely uidmap and slirp4netns, before installing Docker rootless. And afterwards, add these two lines to /home/user/.bashrc:
export PATH=/usr/bin:$PATH
export DOCKER_HOST=unix:///run/user/1000/docker.sock
and it works as a rule.
Running as a Proxmox LXC container has a bit more involved. The container must be created or modified as privileged and with nesting enabled. In addition, the following must be added to /etc/pve/lxc/.conf:
lxc.cgroup2.devices.allow: c 10:200 rwmlxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
Naturally, you must also create a regular user, because dockerd-rootless-setuptool.sh cannot be executed as root. I prefer to install Docker from the Docker repository itself using these commands:
wget -O getdocker.sh https://get.docker.comsudo bash getdocker.shdockerd-rootless-setuptool.sh install
If the installation proceeds without problems, reboot the container and then enter these commands:
systemctl --user start docker.servicesystemctl --user status docker.service
And if the status is OK, have the Docker daemon start at system startup with:
systemctl --user enable docker.service