Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

998
Views
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Problem: I am trying to run docker inside vagrant, my Vagrantfile contains following:-

  config.vm.provision "docker" do |d|
     d.run "ubuntu",
       cmd: "bash -l",
       args: "-v '/vagrant:/var/www'"
  end

docker gets installed but when I run any command it gives the error below:-

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I have tried

  1. https://docs.oracle.com/cd/E52668_01/E75728/html/section_rdz_hmw_2q.html

  2. logged in as root into vagrant and started docker still same problem.

  3. tried chmod on /var/run/docker.sock file

nothing seems to work.

output of ps -ef is

/usr/bin/dockerd

docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir 
/var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Here is what happened to me and what could be a possible solution for someone else. I'm running on Ubuntu 16.04.

I ultimately purged and reinstalled everything from the docker-ce install. I mean everything. Still not working...

Through my internet wizardry I was able to find an article (I can't recall where, there were so many) mentioning that the file located at:

$ sudo nano /etc/systemd/system/docker.service

Had a -d in the place of the daemon at Execstart. That wasn't the case for me. I had ...daemon -D..., but I did notice that it was pointing to /usr/bin/local/docker. That didn't exist, but what does exist is /usr/bin/docker. In that location you will also find docker-containerd, dockerd, etc...

Anyway, I made the change to the docker.service file--simply dropping /local out of there. Saved. Then:

$ systemctl daemon-reload
$ sudo service docker restart
$ sudo service docker status (should see active (running))
$ sudo docker run hello-world

Success!

over 4 years ago · Santiago Trujillo Report

0

On your ssh server, run:

  1. systemctl start docker

  2. systemctl status docker

Docker will start on the server and have a socket on its respective.

over 4 years ago · Santiago Trujillo Report

0

I faced a similar issue, running the command sudo service docker restart, followed by restarting the docker image fixed the issue for me

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!