29

I am very new to the docker when try to run docker info it gives me following error.

$ docker info
FATA[0000] Get http:///var/run/docker.sock/v1.17/info: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? 

I am using ubuntu 14.04. I followed the installation istructions mentioned on https://docs.docker.com/installation/ubuntulinux/#installing-docker-on-ubuntu

But I'm still getting the error. How can I fix this?

Erik Kaplun
  • 37,128
  • 15
  • 99
  • 111
NehaG
  • 864
  • 1
  • 7
  • 15

5 Answers5

43

This error occurred because I didn't restart my computer after installing docker. Now the above command is working for me.

Austin Lopez
  • 109
  • 11
NehaG
  • 864
  • 1
  • 7
  • 15
  • 1
    Instructions told me to log off, not reboot. I tried that. Maybe I should try rebooting. – Steve Cohen Apr 21 '15 at 13:56
  • 2
    Yup, you have to reboot, in spite of what the directions (don't) say, at least on Ubuntu 14.04.. – Steve Cohen Apr 21 '15 at 14:04
  • @NehaG Any ideas on how to fix it on a CI stateless environment were restarting is not an option? (currently using Ubuntu 12.04 LTS) – Felipe Sabino Jul 29 '15 at 20:09
  • 4
    You don't have to reboot... For reasons best known to docker the docker service does not start automatically when installed. As such, In Ubuntu 14.04 `sudo service docker start` did the trick for me – lukik Aug 09 '15 at 14:11
  • While restarting might work it's good to check if the daemon is running or not. See my answer for more. – SidJ Oct 01 '15 at 00:33
20

This is because the docker service is not automatically started after an install.

You can start the docker service in Ubuntu and its derivatives (looking at you Linux Mint) by typing:

sudo service docker start

To check that docker started, this file should exist:

ls -la /var/run/docker.sock
cstroe
  • 3,740
  • 3
  • 27
  • 16
  • 2
    I had the same problem when `docker` service was already running. I did `sudo service docker restart` and everything turned fine. – Frozen Flame Sep 12 '15 at 06:26
14

I had a similar issue, restarting didn't work. Running docker -d gave me a different error

Error loading docker apparmor profile: exec: "/sbin/apparmor_parser": stat /sbin/apparmor_parser: no such file or directory ()

and ran

 sudo apt-get install apparmor 

to fix the apparmor error

My guess the daemon didn't get started automatically post-install because of the apparmor error. (Your error might be different)

Env: Linux Mint 17.1

Update: Also make sure the user you are using is in the docker group

SidJ
  • 669
  • 12
  • 29
  • After installing `apparmor`, `docker -d` worked, but `docker info` still show that error. – quanta Apr 30 '15 at 07:59
  • Do you see docker running? Run "ps -ef | grep docker" or "cat /var/run/docker.pid" to find the pid. When I get this error I kill the process and let it respawn a new process. – SidJ May 01 '15 at 05:56
  • Didn't worked at first. Then I tried it with `sudo` and it worked (also Linux Mint). I'm not sure however if doing it with `sudo` is a good practice. Would appreciate if someone more knowledgeable shed some light on this. – user2205259 May 08 '15 at 19:36
  • The user should be in docker group if I remember right don't have a docker install right now I can look into. – SidJ Jun 08 '16 at 08:57
3

I had the same problem. I needed add my user to docker group (on /etc/group or uses sudo gpasswd -a user docker - and restarting the session.

OS: Ubuntu 14.04.2 LTS 3.13.0-57-generic x64

rogerio_gentil
  • 359
  • 1
  • 4
  • 17
0

After starting docker. change the owner file with this command:

sudo chown [user]:docker /var/run/docker.sock

if your problem didn't solve after it.

sudo mkdir -p /etc/systemd/system/docker.service.d

then

sudo vim /etc/systemd/system/docker.service.d/options.conf

add this line to options.conf file

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix:// -H tcp://0.0.0.0:2375