This error simply means the Docker client can’t reach a running Docker daemon (i.e. the server-side part of Docker).
Think of the daemon as the “engine”; if it’s off or the socket file is missing/inaccessible the CLI can’t do anything.
Below is a checklist that fixes 95 % of these “Cannot connect to the Docker daemon” situations on Linux (the path /home/pluslab/.docker/desktop/docker.sock tells me you’re probably using Docker Desktop for Linux or WSL-based Docker Desktop, but the same ideas apply to the classic engine too).
────────────────────────────────────────
- Is the Docker daemon actually running?
────────────────────────────────────────
For classic package install (system-wide daemon)
sudo systemctl status docker
For Docker Desktop on Linux (runs as user service)
systemctl --user status docker-desktop
If it’s inactive/dead → start it:
sudo systemctl start docker # classic
systemctl --user start docker-desktop # Docker Desktop
Tip: Enable it to start on boot
sudo systemctl enable docker
systemctl --user enable docker-desktop
────────────────────────────────────────
2. Are you inside the correct “docker context”?
────────────────────────────────────────
Docker Desktop creates a special context that points the CLI to /home//.docker/desktop/docker.sock.
If the desktop daemon isn’t running but the CLI is still using that context, you’ll get this exact error.
Check:
docker context ls
docker context use default # switch to the classic engine socket (/var/run/docker.sock)
If you’re on Docker Desktop and WANT to use the desktop engine, just make sure it’s running first (step 1).
────────────────────────────────────────
3. Does the socket file exist & have the right permissions?
────────────────────────────────────────
ls -l /home/pluslab/.docker/desktop/docker.sock
• If the file isn’t there ⇒ the daemon isn’t running or crashed.
• If it’s there but owned by root (or another user) and you run docker without sudo, you’ll get permission denied or the same “cannot connect” message.
Fix permissions by adding yourself to the docker group:
sudo usermod -aG docker $USER
newgrp docker # or log out/in
(For Docker Desktop the socket often lives in $HOME and is already owned by you, so this is less common.)
────────────────────────────────────────
4. Are you using WSL2 on Windows?
────────────────────────────────────────
You’d see a similar path (\wsl$), but if you’re actually on Windows:
• Make sure Docker Desktop Windows is UP and set to use WSL2.
• Verify wsl.exe -d docker-desktop is running: wsl -l -v
────────────────────────────────────────
5. “It still doesn’t work, show me logs!”
────────────────────────────────────────
Classic daemon:
sudo journalctl -u docker -n 100 --no-pager
Docker Desktop Linux:
journalctl --user -u docker-desktop -n 100 --no-pager
Look for lines like “dial unix …: connect: permission denied” or “failed to start”.
────────────────────────────────────────
6. Quick one-liners / TL;DR
────────────────────────────────────────
Classic Docker Engine
sudo systemctl start docker
sudo usermod -aG docker $USER
docker context use default
Docker Desktop (Linux)
systemctl --user start docker-desktop
docker context use desktop-linux
────────────────────────────────────────
Common pitfalls & how to solve them
────────────────────────────────────────
❌ You installed BOTH the distro’s docker-engine and Docker Desktop → two daemons fighting over /var/run/docker.sock.
✅ Uninstall one of them or pick a different context.
❌ You opened a root shell but still use the “desktop” context that lives in your user’s $HOME → root cannot see that socket.
✅ Either switch context or run as your regular user.
❌ Running inside a container and trying to use the host’s Docker socket, but you didn’t mount it.
✅ docker run -v /var/run/docker.sock:/var/run/docker.sock … OR use DOCKER_HOST=tcp://… for remote daemon.
────────────────────────────────────────
If none of the above helps
────────────────────────────────────────
Reply with:
- The output of
docker context ls
docker info --format '{{.ServerVersion}}' (if it even connects)
- systemctl status outputs (see step 1)
- The last few lines of the journal
I’ll gladly dig deeper! 🐳