{"id":1104,"date":"2017-08-12T17:19:19","date_gmt":"2017-08-12T11:49:19","guid":{"rendered":"http:\/\/www.middlewareprimer.com\/blog\/?p=1104"},"modified":"2017-08-12T17:19:19","modified_gmt":"2017-08-12T11:49:19","slug":"cannot-connect-docker-daemon","status":"publish","type":"post","link":"http:\/\/www.middlewareprimer.com\/blog\/2017\/08\/12\/cannot-connect-docker-daemon\/","title":{"rendered":"Cannot connect to the Docker daemon"},"content":{"rendered":"<p>Cannot connect to the Docker daemon at unix:\/\/\/var\/run\/docker.sock. Is the docker daemon running?<\/p>\n<p>Above message appears when we try to get the info of the Docker or check the status of docker upon installation. I have used CENT OS as part of Docker installation. Below is the error message.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1107\" src=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker6.png\" alt=\"\" width=\"915\" height=\"40\" srcset=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker6.png 915w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker6-300x13.png 300w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker6-768x34.png 768w\" sizes=\"auto, (max-width: 915px) 100vw, 915px\" \/><\/p>\n<p><strong>docker &#8211;version<\/strong> command gives output of the Docker that is installed on OS. Whereas, <strong>docker info<\/strong> command fails to provide information. <strong>docker version<\/strong> command gives info about client and not about server daemon process.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1108 size-full\" src=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker5.png\" alt=\"Cannot connect to the Docker daemon\" width=\"915\" height=\"257\" srcset=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker5.png 915w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker5-300x84.png 300w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker5-768x216.png 768w\" sizes=\"auto, (max-width: 915px) 100vw, 915px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Resolution<\/strong><\/span><\/p>\n<p><strong>1.<\/strong> Check if the user is part of sudoers group or assign sudo provileges to the user. User which we are trying to start the docker should be having sudo access. If you have installed docker using Non Root user, then follow the last message provided during the final step of installation process.<\/p>\n<p>Below message comes up during Installation of Docker,<\/p>\n<p>If you would like to use Docker as a non-root user, you should now consider<br \/>\nadding your user to the &#8220;docker&#8221; group with something like:<\/p>\n<p>sudo usermod -aG docker your-user<\/p>\n<p>Adding a user to the &#8220;docker&#8221; group will grant the ability to run containers which can be used to obtain root privileges on the docker host.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1111 size-full\" src=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker7.png\" alt=\"Cannot connect to the Docker daemon\" width=\"877\" height=\"345\" srcset=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker7.png 877w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker7-300x118.png 300w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker7-768x302.png 768w\" sizes=\"auto, (max-width: 877px) 100vw, 877px\" \/><\/p>\n<p><strong>2.<\/strong> Run the Docker service manually. Use dockered &amp; so that it runs as a service in the background or use service docker start command for starting the docker.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1110 size-full\" src=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker1.png\" alt=\"Cannot connect to the Docker daemon\" width=\"1291\" height=\"186\" srcset=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker1.png 1291w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker1-300x43.png 300w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker1-768x111.png 768w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker1-1024x148.png 1024w\" sizes=\"auto, (max-width: 1291px) 100vw, 1291px\" \/><\/p>\n<p>Check the status of docker after performing any one of the above actions,<\/p>\n<p>systemctl status docker<\/p>\n<p>ps -ef|grep docker<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1105 size-full\" src=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker3.png\" alt=\"Cannot connect to the Docker daemon\" width=\"846\" height=\"116\" srcset=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker3.png 846w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker3-300x41.png 300w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker3-768x105.png 768w\" sizes=\"auto, (max-width: 846px) 100vw, 846px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1109 size-full\" src=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker4.png\" alt=\"Cannot connect to the Docker daemon\" width=\"1590\" height=\"137\" srcset=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker4.png 1590w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker4-300x26.png 300w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker4-768x66.png 768w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2017\/08\/docker4-1024x88.png 1024w\" sizes=\"auto, (max-width: 1590px) 100vw, 1590px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>URLs below for reference,<\/strong><\/p>\n<p><a href=\"https:\/\/docs.docker.com\/engine\/admin\/\" target=\"_blank\" rel=\"noopener\"><span style=\"text-decoration: underline;\">https:\/\/docs.docker.com\/engine\/admin\/<\/span><\/a><\/p>\n<p><a href=\"https:\/\/forums.docker.com\/t\/cannot-connect-to-the-docker-daemon-is-the-docker-daemon-running-on-this-host\/8925\" target=\"_blank\" rel=\"noopener\"><span style=\"text-decoration: underline;\">https:\/\/forums.docker.com\/t\/cannot-connect-to-the-docker-daemon-is-the-docker-daemon-running-on-this-host\/8925<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cannot connect to the Docker daemon at unix:\/\/\/var\/run\/docker.sock. Is the docker daemon running? Above message appears when we try to get the info of the Docker or check the status of docker upon installation. I have used CENT OS as part of Docker installation. Below is the error message. docker &#8211;version command gives output of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[343],"tags":[345,344,347,346],"class_list":["post-1104","post","type-post","status-publish","format-standard","hentry","category-docker","tag-centos","tag-docker","tag-docker-daemon","tag-docker-start"],"_links":{"self":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts\/1104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/comments?post=1104"}],"version-history":[{"count":2,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts\/1104\/revisions"}],"predecessor-version":[{"id":1112,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts\/1104\/revisions\/1112"}],"wp:attachment":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/media?parent=1104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/categories?post=1104"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/tags?post=1104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}