Docker Community Forums

Share and learn in the Docker community.

Permission denied when trying to pull fabric images

I am trying to install hyperledger fabric on my ubuntu machine and have followed all the steps with success except the last one, when using curl command to pull fabric images I get permission denied while trying to connect to docker daemon at unix. I have run the same command using sudo and still the problem persists. Any advice?

A temporary solution would be to change the permission of docker.sock file

Go the terminal and type the following and press enter.

sudo chmod 775 //var/run/docker.sock
However, it is not advised to use the root user for installing software for fabric. Instead, you can do the following:

Create a new user

sudo adduser bibek
Add our user to the sudo group.

sudo usermod -aG sudo bibek
Switch to new user

su - bibek
Then you can install all docker and docker-compose

sudo apt-get install docker-compose
Start and enable docker

sudo usermod -a -G docker $USER
sudo systemctl start docker
sudo systemctl enable docker
You can check if the installation worked by running:

docker run hello-world

Thanks for the reply, however I have solved the error it seems all that was needed was a restart I think to effect a path change as after restarting the machine and running the same code it worked. Thank you