Got permission denied while trying to connect to the Docker daemon socket

Dung Do Tien Dec 28 2020 261

After I installed docker on the AWS ubuntu 20.04 server I typed in some docker commands. For example:

 docker ps

But I got an error : Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json: dial unix /var/run/docker.sock: connect: permission denied.

Please suggest me how to solve this problem

Have 1 answer(s) found.
  • You need to give /var/run/docker.sock read permission by executing the command:

     sudo chmod 666 /var/run/docker.sock
    
    Blue Jame Dec 29 2020
Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips