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

Hello everyone,

So I want to setup Pi-hole on Docker on my Mac, but I keep getting the following error:
ERROR: Couldn’t connect to Docker daemon at http+docker://localhost - is it running?

The Error shows up when I try to Run the compose file to launch pihole:
sudo docker-compose up -d

I’ve already installed and updated docker and docker-compose. I also created the docker-compose.yml file with the recommended configuration.

Your assistance is much appreciated!

Thanks in advance

The error suggests that Docker may not be running or accessible. Try these steps:

Start Docker: Ensure Docker Desktop is running on your Mac.
Permissions: Check if your user has the necessary permissions to access Docker.
Docker Group: Add your user to the ‘docker’ group if not already added.
Restart: Sometimes, restarting Docker can resolve connection issues.
If the issue persists, check Docker’s logs for more details or consider reinstalling Docker.

I hope this serves your need!
PanoramaCharter