{"id":498,"date":"2023-03-22T09:04:54","date_gmt":"2023-03-22T09:04:54","guid":{"rendered":"https:\/\/www.dedicatedcore.com\/blog\/?p=498"},"modified":"2024-11-26T10:51:47","modified_gmt":"2024-11-26T10:51:47","slug":"install-docker-debian","status":"publish","type":"post","link":"https:\/\/www.dedicatedcore.com\/blog\/install-docker-debian\/","title":{"rendered":"How to Install Docker in Debian 11"},"content":{"rendered":"<p>With our thorough step-by-step instructions, you can quickly and easily install Docker on Debian 11 (Bullseye) and be up and running in no time. You can resolve issues quickly with better stability by getting <a href=\"https:\/\/www.dedicatedcore.com\/blog\/install-docker-debian\/\" target=\"_blank\" rel=\"noopener\">up to 50% off<\/a> in vps server Netherlands (Amsterdam).<\/p>\n<p>A well-liked open-source technology called Docker makes it simple for programmers to create, distribute, and run distributed applications. If your operating system is Debian 11 (Bullseye), you might be wondering how to install Docker and begin using containerization. Fortunately, the procedure is simple and doesn&#8217;t need highly developed technical knowledge. To<a href=\"https:\/\/www.dedicatedcore.com\/blog\/install-samba-ubuntu\/\" target=\"_blank\" rel=\"noopener\"> share files from different operating systems<\/a> you need to install Samba on Ubuntu so learn from crashes to do so.<\/p>\n<p>In just a few easy steps, we&#8217;ll demonstrate how to install Docker on Debian 11 (Bullseye) in this blog post. Our step-by-step instructions will help you rapidly get up and running whether you&#8217;re an experienced developer or are just getting started with Docker.\u00a0A dedicated hosting offers the <a href=\"https:\/\/www.dedicatedcore.com\/dedicated-server-uk\/\" target=\"_blank\" rel=\"noopener\">ideal tier 4 DC UK server<\/a> for you with hardware for reliable and secure business.<\/p>\n<h2>Docker Installation on Debian 11 (Bullseye)<\/h2>\n<p>You may install Docker on your Debian 11 system using a variety of methods. For instance, it may be readily installed with only one APT command from the official Debian repositories. The available version, though, may not necessarily be the most recent, which is a drawback to this strategy.<\/p>\n<p>Because of this, I&#8217;ll demonstrate how to set up Docker on Debian 11 using the official Docker repository. This method ensures you always receive the most recent version and automatically acquire all upcoming software updates as soon as they become available. So let&#8217;s get going.<\/p>\n<h3>Step 1: Install the Prerequisites First<\/h3>\n<p>Before adding and using a new HTTPS repository, use the two scripts below to update the package index and set up the requirement.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt update\r\nsudo apt install apt-transport-https ca-certificates curl gnupg lsb-release<\/pre>\n<h3>Step 2: Add the Official GPG Key for Docker.<\/h3>\n<p>In your Debian system, import the Docker GPG repository key next. This security measure guarantees the legitimacy of the software you&#8217;re installing.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">curl -fsSL https:\/\/download.docker.com\/linux\/debian\/gpg | sudo gpg --dearmor -o \/usr\/share\/keyrings\/docker.gpg<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-502\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-official-gpg-key-docker.png\" alt=\"adding the offcial gpg key for docker\" width=\"800\" height=\"152\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-official-gpg-key-docker.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-official-gpg-key-docker-300x57.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-official-gpg-key-docker-150x29.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-official-gpg-key-docker-768x146.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-official-gpg-key-docker-100x19.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-official-gpg-key-docker-700x133.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>You&#8217;ll notice that the command returns nothing.<\/p>\n<h3>Step 3: Add the Docker Repository to Debian 11<\/h3>\n<p>We&#8217;ll add the official Docker repository to our Debian 11 system after importing the GPG keys. This suggests that if a new version is released, the update package will be made accessible together with the rest of your system&#8217;s routine updates.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo \"deb [arch=$(dpkg --print-architecture) signed-by=\/usr\/share\/keyrings\/docker.gpg] https:\/\/download.docker.com\/linux\/debian $(lsb_release -cs) stable\" | sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-503\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-docker-repository-debian.png\" alt=\"add the official docker repo to debian 11\" width=\"800\" height=\"174\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-docker-repository-debian.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-docker-repository-debian-300x65.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-docker-repository-debian-150x33.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-docker-repository-debian-768x167.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-docker-repository-debian-100x22.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/add-docker-repository-debian-700x152.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>The same as the previous command, nothing happens when it is executed. Refresh the package list next.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt update<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-504\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/refresh-package-list.png\" alt=\"update the package base\" width=\"800\" height=\"331\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/refresh-package-list.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/refresh-package-list-300x124.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/refresh-package-list-150x62.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/refresh-package-list-768x318.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/refresh-package-list-100x41.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/refresh-package-list-700x290.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>Our new Docker repository is now accessible and prepared for use, as you can see.<\/p>\n<h3>Step 4: Installing Docker on Debian 11 (Bullseye).<\/h3>\n<p>Run the command below to install Docker&#8217;s most recent release on Debian.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-505\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/docker-install-debian.png\" alt=\"install deocker on debian 11\" width=\"800\" height=\"477\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/docker-install-debian.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/docker-install-debian-300x179.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/docker-install-debian-150x89.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/docker-install-debian-768x458.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/docker-install-debian-100x60.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/docker-install-debian-700x417.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>The following Docker components are installed using this:<\/p>\n<ul>\n<li>The actual Docker engine, docker-ce.<\/li>\n<li>Using the command line tool docker-ce-cli, you can communicate with the Docker daemon.<\/li>\n<li>A container runtime that controls the lifespan of the container is containerd.io.<\/li>\n<li>Docker-build-plugin: A CLI plugin that adds numerous new functionality to the Docker build.<\/li>\n<li>Using compose files, the docker-compose-plugin is a configuration management plugin that automates the building and maintenance of Docker containers.<\/li>\n<\/ul>\n<p>That&#8217;s it. The service should now be running and Docker should be set to launch automatically upon booting. Additionally, you may use the following to determine the status of the Docker service:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo systemctl is-active docker<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-506\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/check-docker-service-status.png\" alt=\"check the status of the docker service\" width=\"800\" height=\"143\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/check-docker-service-status.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/check-docker-service-status-300x54.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/check-docker-service-status-150x27.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/check-docker-service-status-768x137.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/check-docker-service-status-100x18.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/check-docker-service-status-700x125.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<h3>Step 5: Verify the Docker Installation in this Step.<\/h3>\n<p>Let&#8217;s now test our new Docker installation to see if everything functions as it should. We shall use the straightforward &#8220;hello-world&#8221; application to serve this goal.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo docker run hello-world<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-507\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/verify-docker-installation.png\" alt=\"docker successfully installed &amp; running on debian 11\" width=\"800\" height=\"671\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/verify-docker-installation.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/verify-docker-installation-300x252.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/verify-docker-installation-150x126.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/verify-docker-installation-768x644.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/verify-docker-installation-100x84.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/verify-docker-installation-537x450.png 537w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>Congratulations! As you can see, everything functions as it should.<\/p>\n<h4>Providing Non-root Users with Access to Docker Commands<\/h4>\n<p>As of right now, your Debian 11 system has Docker installed successfully. However, by default, Docker commands can only be run by root and users with sudo capabilities. In other words, if you try to run the docker command without adding the sudo prefix, you&#8217;ll see the following error message:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-508\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/error-message-docker-permission-denied.png\" alt=\"docker permission denied\" width=\"800\" height=\"189\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/error-message-docker-permission-denied.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/error-message-docker-permission-denied-300x71.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/error-message-docker-permission-denied-150x35.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/error-message-docker-permission-denied-768x181.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/error-message-docker-permission-denied-100x24.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/error-message-docker-permission-denied-700x165.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<p>Therefore, you must add your user to the docker group to execute Docker commands as a non-root user. Enter the following text to do that:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo usermod -aG docker ${USER}<\/pre>\n<p>Your username is stored in the environment variable $USER in the command above. Reboot your Debian system to submit a membership application for the new group. Then, you won&#8217;t need to use the sudo prefix while running docker commands.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-509\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/run-docker-command-regular-user.png\" alt=\"running docker command as regular user\" width=\"800\" height=\"155\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/run-docker-command-regular-user.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/run-docker-command-regular-user-300x58.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/run-docker-command-regular-user-150x29.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/run-docker-command-regular-user-768x149.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/run-docker-command-regular-user-100x19.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/run-docker-command-regular-user-700x136.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<h4>Final Thought How to Install Docker on Debian 11 (Bullseye) in the Easy Way<\/h4>\n<p>Docker installation on Debian 11 (Bullseye) is an easy process that only requires a few simple steps to complete. Users may quickly download and install the newest version of Docker on their Debian computers with the aid of the official Docker repository.<\/p>\n<p>Using the straightforward way, you were able to successfully install Docker on your Debian 11 (Bullseye) system. Now that Docker is up and running, you have a potent tool for easily isolating and managing apps inside containers.<\/p>\n<p>Docker offers a flexible and effective method for establishing scalable environments, deploying applications, and testing new technologies. Utilize this robust platform now and discover the countless opportunities that Docker presents to simplify your development and deployment procedures.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With our thorough step-by-step instructions, you can quickly and easily install Docker on Debian 11 (Bullseye) and be up and running in no time. You&#8230;<\/p>\n","protected":false},"author":1,"featured_media":519,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/498"}],"collection":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/comments?post=498"}],"version-history":[{"count":11,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/498\/revisions"}],"predecessor-version":[{"id":2578,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/498\/revisions\/2578"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/media\/519"}],"wp:attachment":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/media?parent=498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/categories?post=498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/tags?post=498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}