{"id":9272,"date":"2024-01-11T04:47:58","date_gmt":"2024-01-11T04:47:58","guid":{"rendered":"https:\/\/www.bacancytechnology.com\/qanda\/?p=9272"},"modified":"2024-01-11T04:52:36","modified_gmt":"2024-01-11T04:52:36","slug":"how-to-fix-docker-permission-denied-issue","status":"publish","type":"post","link":"https:\/\/www.bacancytechnology.com\/qanda\/cloud\/how-to-fix-docker-permission-denied-issue","title":{"rendered":"How to Fix Docker: Got Permission Denied Issue"},"content":{"rendered":"<p>By default, the docker command can only be run by the root user or by a user in the docker group, which is automatically created during Docker\u2019s installation process. If you attempt to run the docker command without prefixing it with sudo or without being in the docker group, you\u2019ll get an output like this:<\/p>\n<h3>Error:<\/h3>\n<p>docker: Got permission denied while trying to connect to the Docker daemon socket at unix:\/\/\/var\/run\/docker.sock: Post http:\/\/%2Fvar%2Frun%2Fdocker.sock\/v1.35\/containers\/create: dial unix \/var\/run\/docker.sock: connect: permission denied. See &#8216;docker run &#8211;help&#8217;.<\/p>\n<h3>Resolution:<\/h3>\n<p>add your username to the docker group<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dockerfile\">sudo usermod -aG docker ${USER}\r\n\r\nTo apply the new group membership, log out of the server and back in, or type the following:\r\n\r\nsu - ${USER}\r\n\r\nYou will be prompted to enter your user\u2019s password to continue.\r\nConfirm that your user is now added to the docker group by typing:\r\n\r\ngroups\r\n\r\nIf you need to add a user to the docker group that you\u2019re not logged in as, declare that username explicitly using:\r\nsudo usermod -aG docker &lt;username&gt;\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, the docker command can only be run by the root user or by a user in the docker group, which is automatically created during Docker\u2019s installation process. If you attempt to run the docker command without prefixing it with sudo or without being in the docker group, you\u2019ll get an output like this: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9281,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[17],"tags":[],"class_list":["post-9272","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/9272"}],"collection":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/comments?post=9272"}],"version-history":[{"count":3,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/9272\/revisions"}],"predecessor-version":[{"id":9275,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/9272\/revisions\/9275"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media\/9281"}],"wp:attachment":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media?parent=9272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/categories?post=9272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/tags?post=9272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}