Beginner mistake? cannot connect to deamon as user on Debian 11

Hi all,

hope this is the right place!

  • installed docker on my Debian 11 machine like described in:
    Install Docker Engine on Debian
  • Engine started
  • Tested “hello-World” successful
  • added user to group “docker”
  • logged out and in again

And as user it doesn’t work. What’s going wrong?
My first Test on an Windows machine was successful with the same steps!

~$ docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///home/sroth/.docker/desktop/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

Docker service is running.

~# systemctl status docker.service
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-02-28 11:51:37 CET; 34min ago
TriggeredBy: ● docker.socket
   Main PID: 3405 (dockerd)
      Tasks: 10
     Memory: 45.6M
        CPU: 1.332s
     CGroup: /system.slice/docker.service
             └─3405 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Feb 28 11:51:37 sroth dockerd[3405]: time="2023-02-28T11:51:37.363594342+01:00" level=info msg="Loading containers: done."
Feb 28 11:51:37 sroth dockerd[3405]: time="2023-02-28T11:51:37.393696346+01:00" level=info msg="Docker daemon" commit=bc3805a graphdriver=overlay2 version=23.0.1
Feb 28 11:51:37 sroth dockerd[3405]: time="2023-02-28T11:51:37.393830888+01:00" level=info msg="Daemon has completed initialization"
Feb 28 11:51:37 sroth dockerd[3405]: time="2023-02-28T11:51:37.416391418+01:00" level=info msg="[core] [Server #7] Server created" module=grpc
Feb 28 11:51:37 sroth systemd[1]: Started Docker Application Container Engine.
Feb 28 11:51:37 sroth dockerd[3405]: time="2023-02-28T11:51:37.424818784+01:00" level=info msg="API listen on /run/docker.sock"
Feb 28 12:01:05 sroth dockerd[3405]: time="2023-02-28T12:01:05.204806946+01:00" level=info msg="ignoring event" container=eaab3e2afde8d806df32a1b77bbeed737d673480403ccfbd04a6354462a5b132 module=libc
Feb 28 12:01:26 sroth dockerd[3405]: time="2023-02-28T12:01:26.832562048+01:00" level=info msg="ignoring event" container=a987cb1e51d21fa4726be3e0a6cda02188f494e36b9eb3ffefe9e30874eaa876 module=libc
Feb 28 12:02:46 sroth dockerd[3405]: time="2023-02-28T12:02:46.960548547+01:00" level=info msg="ignoring event" container=c180d6f730b8da9710e632997f9767e7c38ce5536510dc901c4d6d3d08cbc892 module=libc
Feb 28 12:04:56 sroth dockerd[3405]: time="2023-02-28T12:04:56.164006462+01:00" level=error msg="Not continuing with pull after error: manifest unknown: manifest unknown"


It seems from the error, that its looking for the docket socket in your home dir.
Maybe you have had Docker Desktop installed and then decided on docker engine?

What does:

docker context ls


I had Docker-Desktop installed and completely removed (incl. directory /home/xxxx/.docker*)
before new Installation of the engine!

docker context ls
NAME              DESCRIPTION                               DOCKER ENDPOINT                                  ERROR
default           Current DOCKER_HOST based configuration   unix:///var/run/docker.sock                      
desktop-linux *                                             unix:///home/xxxxx/.docker/desktop/docker.sock   

Okay, try:

docker context use default

and then try a docker ps / run command again

It works!!! Thank you very much. Where can i find such solutions to repair errors by myself?

Just think you need to work a bit with Docker to “know” it, you can read about contexts here: