20

I am trying to run my Docker commands, but I am facing the notification error in the title. I tried running:

ps auxww | grep docker

but still getting the error. Any solution?

Eric Platon
  • 9,819
  • 6
  • 41
  • 48
Bhim singh dangi
  • 417
  • 1
  • 5
  • 12
  • 1
    What is the output of `ps aux | grep docker`? What command exactly are you trying? – jobin Aug 20 '14 at 13:02
  • I am running in to similar error while trying to connect to Docker running on another system [link](http://stackoverflow.com/questions/33459411/not-able-to-connect-to-the-docker-server-running-on-another-linux-system) – Andy Nov 01 '15 at 05:18

3 Answers3

38

If you can verify that the docker daemon is running then it may be that your user is not allowed to access docker.

To do this add yourself to the docker group.

sudo usermod -aG docker <userid>

Remember to do a re-login or otherwise apply/activate the new group permission.

newgrp docker
rondemena
  • 183
  • 5
straville
  • 986
  • 3
  • 15
  • 21
  • Ubuntu 16.04 here, I added myself to the docker group. I had to use username instead of user id. I opened another terminal but still get the same result. – Csaba Toth Nov 04 '16 at 15:49
  • Oh, after adding myself to the group I needed a `sudo service docker restart` – Csaba Toth Nov 04 '16 at 15:51
  • 3
    adding to group and restarting, still got the same result – Zein Miftah Nov 15 '16 at 08:31
  • 2
    @ZeinMiftah Restarting the terminal fixed it for me. Also just to be sure, you can run this: `sudo groupadd docker` `sudo gpasswd -a docker` And verify the changes by looking into `/etc/group` file. – Indradhanush Gupta Dec 05 '16 at 13:07
  • how do you verify the docker daemon is running? – activedecay Sep 28 '17 at 22:52
  • 1
    @activedecay Dedepends on the used guest OS See:https://docs.docker.com/engine/admin/ | For Ubuntu/Debian based distros: Basic service control methods list, stop, start Such as: `sudo initctl list` and `sudo service --status-all` | In RH distros you would use the systemctl command, e.g: `systemctl status docker.service` -> try restart, in necessary. | Use: ps -ef | grep docker | If those sources say it's "running" you can be better confident that it is running. | HOWEVER possible OS hardening features (AppArmor / SeLinux) can cause trouble.. disable *ONLY* for testing purposes. : ] – straville Oct 19 '17 at 16:39
15

How about launching the daemon

sudo service docker start

should do the trick.

Or

sudo docker -d
Regan
  • 8,231
  • 5
  • 23
  • 23
  • 3
    says that start: Job is already running: docker, but still getting the error from the question title – Elzo Valugi Jan 07 '16 at 08:12
  • `Jonathans-MacBook-Air:~ jonny$ docker -d` `flag provided but not defined: -d` `See 'docker --help'.` – Jonathan Jun 15 '16 at 23:46
  • @LuísdeSousa "sudo service docker start" worked for me on 16.04, but I had to also add my user to the docker group as straville mentioned. – Mr.WorshipMe Aug 10 '16 at 18:43
0

In my case I had multiple docker instances running so it didn't know what to attach to. After killing them and restarting, my problem was solved.

ferics2
  • 5,241
  • 7
  • 30
  • 46