title: docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? for Ubuntu 16.04
body: <p>Getting the above error while running any docker command.
  When i run the following command
  <hr>
  <code>$ sudo docker info</code><br>
  <em>Output</em><br></p>
  
  <pre><code>Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  </code></pre>
  
  <p><br><br>
  <strong>None of the docker commands are working. All of them throws same error.</strong> <hr>
  <code>$ sudo systemctl status docker</code><br>
  <em>Output.</em><br></p>
  
  <pre><code>● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/docker.service.d
             └─docker-override.conf
     Active: inactive (dead) (Result: exit-code) since Mon 2018-07-02 09:27:04 EDT; 1min 2s ago
       Docs: https://docs.docker.com
    Process: 23866 ExecStart=/usr/bin/dockerd -H fd:// -s overlay2 --disable-legacy-registry=false &lt;br&gt;(code=exited, status=1/FAILURE)
   Main PID: 23866 (code=exited, status=1/FAILURE)
  
  Jul 02 09:27:04 cse-bennettuniv systemd[1]: Failed to start Docker Application Container Engine.
  Jul 02 09:27:04 cse-bennettuniv systemd[1]: docker.service: Unit entered failed state.
  Jul 02 09:27:04 cse-bennettuniv systemd[1]: docker.service: Failed with result 'exit-code'.
  Jul 02 09:27:04 cse-bennettuniv systemd[1]: docker.service: Service hold-off time over, scheduling restart.
  Jul 02 09:27:04 cse-bennettuniv systemd[1]: Stopped Docker Application Container Engine.
  Jul 02 09:27:04 cse-bennettuniv systemd[1]: docker.service: Start request repeated too quickly.
  Jul 02 09:27:04 cse-bennettuniv systemd[1]: Failed to start Docker Application Container Engine.
  </code></pre>
  
  <p><hr>
  <code>$ sudo systemctl status nvidia-docker</code><br>
  <em>Output</em><br></p>
  
  <pre><code>● nvidia-docker.service - NVIDIA Docker plugin
     Loaded: loaded (/lib/systemd/system/nvidia-docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2018-07-02 08:54:55 EDT; 37min ago
       Docs: https://github.com/NVIDIA/nvidia-docker/wiki
   Main PID: 3173 (nvidia-docker-p)
      Tasks: 10
     Memory: 61.8M
        CPU: 3.739s
     CGroup: /system.slice/nvidia-docker.service
             └─3173 /usr/bin/nvidia-docker-plugin -s /var/lib/nvidia-docker
  
  Jul 02 08:54:55 cse-bennettuniv systemd[1]: Starting NVIDIA Docker plugin...
  Jul 02 08:54:55 cse-bennettuniv systemd[1]: Started NVIDIA Docker plugin.
  Jul 02 08:54:55 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:55 Loading NVIDIA unified memory
  Jul 02 08:54:55 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:55 Loading NVIDIA management library
  Jul 02 08:54:55 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:55 Discovering GPU devices
  Jul 02 08:54:59 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:59 Provisioning volumes at /var/lib/nvidia-docker/volumes
  Jul 02 08:54:59 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:59 Serving plugin API at /var/lib/nvidia-docker
  Jul 02 08:54:59 cse-bennettuniv nvidia-docker-plugin[3173]: /usr/bin/nvidia-docker-plugin | 2018/07/02 08:54:59 Serving remote API at localhost:3476
  </code></pre>
  
  <p><hr>
  When I run the following comman...<br>
  <code>$ sudo service docker restart</code><br>
  <em>Output</em><br>
  <code>Job for docker.service failed because the control process exited with error code. See _"systemctl status docker.service"_ and _"journalctl -xe"_ for details.</code><br>
  <hr>
  I have already run the <em>"systemctl status docker.service"</em> and I also run the <em>"journalctl -xe"</em> command to understand whats the problem.  The journalctl output contains</p>
  
  <pre><code>Jul 03 13:23:06 cse-bennettuniv systemd[1]: Starting Docker Application Container Engine...
  Jul 03 13:23:06 cse-bennettuniv dockerd[9390]: ERROR: The '--disable-legacy-registry' flag has been removed. Interacting with legacy (v1) registries is no longer supported
  Jul 03 13:23:06 cse-bennettuniv systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
  Jul 03 13:23:06 cse-bennettuniv systemd[1]: Failed to start Docker Application Container Engine.
  Jul 03 13:23:06 cse-bennettuniv systemd[1]: docker.service: Unit entered failed state.
  Jul 03 13:23:06 cse-bennettuniv systemd[1]: docker.service: Failed with result 'exit-code'.
  Jul 03 13:23:06 cse-bennettuniv systemd[1]: docker.service: Service hold-off time over, scheduling restart.
  Jul 03 13:23:06 cse-bennettuniv systemd[1]: Stopped Docker Application Container Engine.
  </code></pre>
  
  <p><a href="https://github.com/NVIDIA/nvidia-docker/files/2160456/journalctl-docker.txt" rel="nofollow noreferrer">A more complete txt file of the outpot thrown by <em>"journalctl -xe"</em> command</a></p>
  
  <hr>