Handle docker error: Couldn’t connect to Docker daemon

Issue:

ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

The Docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can only access it using sudo. The Docker daemon always runs as the root user. If you don’t want to preface the docker command with sudo, create a Unix group called docker and add users to it. When the Docker daemon starts, it creates a Unix socket accessible by members of the docker group.

sudo groupadd docker
sudo usermod -aG docker $USER

Now log out and log in or reboot to preserve changes.