title: Docker: PermissionError: [Errno 13] Permission denied
body: <p>I got this when I was running docker-compose</p>
  <pre class="lang-sh prettyprint-override"><code>Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post &quot;http://%2Fvar%2Frun%2Fdocker.sock/v1.24/build?buildargs=%7B%7D&amp;cachefrom=%5B%5D&amp;cgroupparent=&amp;cpuperiod=0&amp;cpuquota=0&amp;cpusetcpus=&amp;cpusetmems=&amp;cpushares=0&amp;dockerfile=Dockerfile&amp;labels=%7B%7D&amp;memory=0&amp;memswap=0&amp;networkmode=default&amp;rm=1&amp;shmsize=0&amp;t=iramiro-api.jar&amp;target=&amp;ulimits=null&amp;version=1&quot;: dial unix /var/run/docker.sock: connect: permission denied
  Running docker compose
  [6099] Failed to execute script docker-compose
  Traceback (most recent call last):
    File &quot;urllib3/connectionpool.py&quot;, line 677, in urlopen
    File &quot;urllib3/connectionpool.py&quot;, line 392, in _make_request
    File &quot;http/client.py&quot;, line 1252, in request
    File &quot;http/client.py&quot;, line 1298, in _send_request
    File &quot;http/client.py&quot;, line 1247, in endheaders
    File &quot;http/client.py&quot;, line 1026, in _send_output
    File &quot;http/client.py&quot;, line 966, in send
    File &quot;docker/transport/unixconn.py&quot;, line 43, in connect
  PermissionError: [Errno 13] Permission denied
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;requests/adapters.py&quot;, line 449, in send
    File &quot;urllib3/connectionpool.py&quot;, line 727, in urlopen
    File &quot;urllib3/util/retry.py&quot;, line 403, in increment
    File &quot;urllib3/packages/six.py&quot;, line 734, in reraise
    File &quot;urllib3/connectionpool.py&quot;, line 677, in urlopen
    File &quot;urllib3/connectionpool.py&quot;, line 392, in _make_request
    File &quot;http/client.py&quot;, line 1252, in request
    File &quot;http/client.py&quot;, line 1298, in _send_request
    File &quot;http/client.py&quot;, line 1247, in endheaders
    File &quot;http/client.py&quot;, line 1026, in _send_output
    File &quot;http/client.py&quot;, line 966, in send
    File &quot;docker/transport/unixconn.py&quot;, line 43, in connect
  urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;docker/api/client.py&quot;, line 205, in _retrieve_server_version
    File &quot;docker/api/daemon.py&quot;, line 181, in version
    File &quot;docker/utils/decorators.py&quot;, line 46, in inner
    File &quot;docker/api/client.py&quot;, line 228, in _get
    File &quot;requests/sessions.py&quot;, line 543, in get
    File &quot;requests/sessions.py&quot;, line 530, in request
    File &quot;requests/sessions.py&quot;, line 643, in send
    File &quot;requests/adapters.py&quot;, line 498, in send
  requests.exceptions.ConnectionError: ('Connection aborted.', PermissionError(13, 'Permission denied'))
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;bin/docker-compose&quot;, line 3, in &lt;module&gt;
    File &quot;compose/cli/main.py&quot;, line 67, in main
    File &quot;compose/cli/main.py&quot;, line 123, in perform_command
    File &quot;compose/cli/command.py&quot;, line 69, in project_from_options
    File &quot;compose/cli/command.py&quot;, line 132, in get_project
    File &quot;compose/cli/docker_client.py&quot;, line 43, in get_client
    File &quot;compose/cli/docker_client.py&quot;, line 170, in docker_client
    File &quot;docker/api/client.py&quot;, line 188, in __init__
    File &quot;docker/api/client.py&quot;, line 213, in _retrieve_server_version
  docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))
  [Pipeline] }
  [Pipeline] // stage
  [Pipeline] }
  [Pipeline] // withEnv
  [Pipeline] }
  [Pipeline] // withEnv
  [Pipeline] }
  [Pipeline] // node
  [Pipeline] End of Pipeline
  ERROR: script returned exit code 255
  Finished: FAILURE
  </code></pre>