{"id":10820,"date":"2021-10-05T08:29:32","date_gmt":"2021-10-05T08:29:32","guid":{"rendered":"https:\/\/linuxways.net\/?p=10820"},"modified":"2021-10-05T08:29:32","modified_gmt":"2021-10-05T08:29:32","slug":"how-to-install-docker-on-debian-11","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/how-to-install-docker-on-debian-11\/","title":{"rendered":"How to Install Docker on Debian 11"},"content":{"rendered":"<p>Docker is an open-source and most popular platform nowadays. It provides support to create and run applications in isolated \u2018containers\u2019. Dockers allow developers to easily ship, pack and run any application along with all dependencies in a standardized lightweight and portable container that can run virtually anywhere. Containers are much more efficient and faster than any other virtual machine because they are executable that serves the applications rather than running an entire operating system.<\/p>\n<p>You will go through this article about the installation of Docker community edition (CE) on the Debian 11 bullseye system using the command line approach.<\/p>\n<h2><strong>Prerequisites<\/strong><\/h2>\n<ul>\n<li>You must need root privileges.<\/li>\n<li>The user required a 64-bit version of the Debian 11 operating system.<\/li>\n<\/ul>\n<h2><strong>Installation of Docker engine on Debian 11 bullseye distribution<\/strong><\/h2>\n<p>The installation of Docker will complete into the number of steps, which are provided below:<\/p>\n<h3><strong>Step 1: Remove old Docker packages<\/strong><\/h3>\n<p>If you installed Docker on your system before then, first you need to uninstall all older packages along with the dependencies called docker-engine or docker. However, the uninstallation process would not remove existing docker images, files, and networks that are present in the \/var\/lib\/docker\/ directory. So, run the below-mentioned command to uninstall the older docker version:<\/p>\n<pre>$ sudo apt remove -y docker docker-engine docker.io containerd runc<\/pre>\n<h3><strong>Step 2: Install important Docker\u2019s packages\u00a0<\/strong><\/h3>\n<p>Refresh the apt packages repository list by using the below-given command:<\/p>\n<pre>$ sudo apt update<\/pre>\n<p>Now, install some important required packages for the support the of HTTPS method by using the following command:<\/p>\n<pre>$ sudo apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common<\/pre>\n<p>The following output will print after installing all the above-required Docker packages.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"984\" height=\"635\" class=\"wp-image-10821\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-55.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-55.png 984w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-55-300x194.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-55-768x496.png 768w\" sizes=\"auto, (max-width: 984px) 100vw, 984px\" \/><\/p>\n<h3><strong>Step 3: Add the Docker\u2019s Repository<\/strong><\/h3>\n<p>In this step, import the Docker\u2019s repository GPG key on your system by running the below-mentioned command:<\/p>\n<pre>$ curl -fsSL https:\/\/download.docker.com\/linux\/debian\/gpg | sudo gpg --dearmor -o \/usr\/share\/keyrings\/docker-archive-keyring.gpg<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"980\" height=\"92\" class=\"wp-image-10822\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-56.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-56.png 980w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-56-300x28.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-56-768x72.png 768w\" sizes=\"auto, (max-width: 980px) 100vw, 980px\" \/><\/p>\n<p>Once you have included the GPG key, run the following command to add the Docker\u2019s repository to the source list of your system:<\/p>\n<pre>$ echo \"deb [arch=amd64 signed-by=\/usr\/share\/keyrings\/docker-archive-keyring.gpg] https:\/\/download.docker.com\/linux\/debian $(lsb_release -cs) stable\" | sudo tee \/etc\/apt\/sources.list.d\/docker.list<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"982\" height=\"139\" class=\"wp-image-10823\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-57.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-57.png 982w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-57-300x42.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-57-768x109.png 768w\" sizes=\"auto, (max-width: 982px) 100vw, 982px\" \/><\/p>\n<p>After adding a new docker\u2019s repository, refresh the apt repository by executing the \u2018sudo apt update\u2019 command.<\/p>\n<h3><strong>Step 4: Docker installation on Debian 11 system<\/strong><\/h3>\n<p>Once you setup the docker\u2019s repository on your Debian 11 bullseye system, install the Docker engine with the help of the following \u2018apt\u2019 command:<\/p>\n<pre>$ sudo apt install -y docker-ce docker-ce-cli containerd.io<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"980\" height=\"583\" class=\"wp-image-10824\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-58.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-58.png 980w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-58-300x178.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-58-768x457.png 768w\" sizes=\"auto, (max-width: 980px) 100vw, 980px\" \/><\/p>\n<p>Check the installation of Docker (CE) on the Debian 11 system by showing the information about the installed Docker\u2019s version as follows:<\/p>\n<pre>$ docker --version<\/pre>\n<p>The installed docker version should display on the terminal window, which is also shown in the below-given screenshot:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"986\" height=\"74\" class=\"wp-image-10825\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-59.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-59.png 986w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-59-300x23.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-59-768x58.png 768w\" sizes=\"auto, (max-width: 986px) 100vw, 986px\" \/><\/p>\n<p>Check the running status of the docker service by using the \u2018systemctl\u2019 command as follows:<\/p>\n<pre>$ sudo systemctl status docker<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"981\" height=\"543\" class=\"wp-image-10826\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-60.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-60.png 981w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-60-300x166.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-60-768x425.png 768w\" sizes=\"auto, (max-width: 981px) 100vw, 981px\" \/><\/p>\n<h3><strong>Step 5: Test Docker installation<\/strong><\/h3>\n<p>To test the Docker installation on your system, run the \u2018hello-world\u2019 docker contained by executing the below-mentioned command:<\/p>\n<pre>$ sudo docker run hello-world<\/pre>\n<p>The following output shows on the terminal that verifies the correct installation of the Docker engine on your Debian 11 bullseye distribution.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"988\" height=\"600\" class=\"wp-image-10827\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-61.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-61.png 988w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-61-300x182.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-61-768x466.png 768w\" sizes=\"auto, (max-width: 988px) 100vw, 988px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Congratulations! The Docker engine is installed on the Debian 11 system. We explored different commands in this article for the installation of the Docker engine on the Debian 11 bullseye system. In the next coming articles, we will also show you how to allow access to non-root users to execute the docker commands. Thanks!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"987\" height=\"68\" class=\"wp-image-10828\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-62.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-62.png 987w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-62-300x21.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-62-768x53.png 768w\" sizes=\"auto, (max-width: 987px) 100vw, 987px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>Docker is an open-source and most popular platform nowadays. It provides support to create and run applications in isolated \u2018containers\u2019. Dockers allow developers to easily ship, pack and&hellip;<\/p>","protected":false},"author":1,"featured_media":10937,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[521,160],"class_list":["post-10820","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","tag-debian-11","tag-docker"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10820","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=10820"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10820\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/10937"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=10820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=10820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=10820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}