{"id":127940,"date":"2025-05-08T19:12:55","date_gmt":"2025-05-08T19:12:55","guid":{"rendered":"\/tutorials\/?p=127940"},"modified":"2025-05-09T07:14:08","modified_gmt":"2025-05-09T07:14:08","slug":"how-to-install-docker-debian","status":"publish","type":"post","link":"\/in\/tutorials\/how-to-install-docker-debian","title":{"rendered":"How to install Docker on Debian 12: repository setup and verification"},"content":{"rendered":"<p>As a containerized platform, Docker lets you develop and run apps in isolated environments without modifying your system. Developers and sysadmins also use it to test experimental code. If something breaks during testing, it won&rsquo;t affect the rest of your setup.<\/p><p>Meanwhile, Debian is a Linux distribution known for its rock-solid stability, making it a popular choice for running Docker in production or long-term environments. It receives fewer updates than rolling-release distros like Arch Linux, but each is thoroughly tested for reliability.<\/p><p>Docker officially supports Debian, so you&rsquo;ll get regular updates from Docker&rsquo;s repository, compatibility with essential tools like Docker Engine, Compose, CLI, and Containerd, and reliable community support.<\/p><p>In this article, you&rsquo;ll learn how to install Docker on Debian 12 &ndash; from setting up the required dependencies to verifying that Docker runs correctly on your system.<\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-prerequisites-for-installing-docker-on-debian\"><strong>Prerequisites for installing Docker on Debian<\/strong><\/h2><p>Before starting the Docker installation process, make sure your system runs either Debian <strong>11<\/strong> (Bullseye) or <strong>12<\/strong> (Bookworm). If you&rsquo;re unsure which Debian version you have, open your terminal and run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">lsb_release -a<\/pre><p>Here&rsquo;s the expected output:<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1ab523eb85\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"268\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/terminal-debian-version-1024x268.png\" alt=\"A terminal output showing the installed Debian version\" class=\"wp-image-127942\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-debian-version-1024x268.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-debian-version-300x79.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-debian-version-150x39.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-debian-version-768x201.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-debian-version.png 1252w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Next, confirm that you use a root user account or have sudo privileges. On personal computers, you typically have the necessary permissions by default.<\/p><p>If you own a<a href=\"\/in\/tutorials\/what-is-vps-hosting\"> virtual private server (VPS)<\/a>, verify your access level with your provider. On Hostinger&rsquo;s <a href=\"\/in\/vps\/docker-hosting\">Docker VPS plans<\/a>, you get full root privileges to proceed without restrictions.<\/p><p>VPS users will also need SSH access to connect to their server remotely. Hostinger customers can find their SSH credentials in <strong>hPanel &rarr; VPS &rarr; Manage &rarr; Overview &rarr; VPS details<\/strong>.<\/p><figure data-wp-context='{\"imageId\":\"69e1ab5241196\"}' data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"445\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/hpanel-vps-overview-vps-details-highlighted-1024x445.png\" alt=\"The VPS details section in the Overview page of hPanel's VPS\n\" class=\"wp-image-127943\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-vps-details-highlighted-1024x445.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-vps-details-highlighted-300x130.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-vps-details-highlighted-150x65.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-vps-details-highlighted-768x333.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-vps-details-highlighted-1536x667.png 1536w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-vps-details-highlighted-2048x889.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><p>Hostinger also offers a <strong>Browser terminal<\/strong> feature, so you can run<a href=\"\/in\/tutorials\/linux-commands\"> Linux commands<\/a> directly from your browser. This is handy if you don&rsquo;t have a terminal app installed on your device. Just hit the designated button in the top right corner of your <strong>VPS Overview<\/strong> page to get started.<\/p><figure data-wp-context='{\"imageId\":\"69e1ab5243813\"}' data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"534\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/hpanel-vps-overview-browser-terminal-highlighted-1024x534.png\" alt=\"The Browser terminal button in the Overview page of hPanel's VPS\n\" class=\"wp-image-127944\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-browser-terminal-highlighted-1024x534.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-browser-terminal-highlighted-300x157.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-browser-terminal-highlighted-150x78.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-browser-terminal-highlighted-768x401.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-browser-terminal-highlighted-1536x801.png 1536w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/hpanel-vps-overview-browser-terminal-highlighted-2048x1069.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/in\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-installing-docker-on-debian\"><strong>Installing Docker on Debian<\/strong><\/h2><p>After preparing the prerequisites, it&rsquo;s time to set up Docker on Debian <strong>12<\/strong> &ndash; the same steps apply to Debian <strong>11<\/strong>. The entire process should take less than <strong>five minutes<\/strong>.<\/p><h3 class=\"wp-block-heading\" id=\"h-1-update-your-system\"><strong>1. Update your system<\/strong><\/h3><p>As with installing other software, update your Debian system first to use the latest package lists and security patches. This helps prevent compatibility issues and ensures Docker installs smoothly.<\/p><p>Execute the following commands:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt update<\/pre><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt upgrade -y<\/pre><p>The first command updates your package index with the latest versions available in your repositories. The second one upgrades any outdated packages already installed on your system.<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1ab5247390\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"564\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/terminal-upgrade-debian-package-1024x564.png\" alt=\"A terminal output showing the process of upgrading Debian packages\" class=\"wp-image-127946\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-upgrade-debian-package-1024x564.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-upgrade-debian-package-300x165.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-upgrade-debian-package-150x83.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-upgrade-debian-package-768x423.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-upgrade-debian-package-1536x845.png 1536w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-upgrade-debian-package-2048x1127.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Pro tip<\/h4>\n                    <p>Besides running the update commands one by one, you can execute them in one go by adding <strong>&amp;&amp;<\/strong> between them like this:<br>\n<strong>sudo apt update &amp;&amp; sudo apt upgrade -y<\/strong><br>\nThis method saves time and makes the update process more efficient.<\/p>\n                <\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-2-install-required-dependencies\"><strong>2. Install required dependencies<\/strong><\/h3><p>Next, install a few prerequisite packages to let your Debian system access external resources securely. These packages include:<\/p><ul class=\"wp-block-list\">\n<li><strong>ca-certificates<\/strong> &ndash; helps your system verify SSL certificates and connect to secure servers.<\/li>\n\n\n\n<li><a href=\"\/in\/tutorials\/curl-command\">curl<\/a> &ndash; a tool for downloading files from the internet via the command line.<\/li>\n<\/ul><p>Install them with this command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install ca-certificates curl<\/pre><p>After that, create a keyring directory to store Docker&rsquo;s GPG key. This ensures a secure and organized package signing process:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo install -m 0755 -d \/etc\/apt\/keyrings<\/pre><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1ab5249d4a\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"264\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/terminal-ca-certificates-curl-keyring-1024x264.png\" alt=\"A terminal output after installing required tools and creating a keyring directory\" class=\"wp-image-127947\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-ca-certificates-curl-keyring-1024x264.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-ca-certificates-curl-keyring-300x77.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-ca-certificates-curl-keyring-150x39.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-ca-certificates-curl-keyring-768x198.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-ca-certificates-curl-keyring-1536x396.png 1536w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-ca-certificates-curl-keyring.png 1684w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-3-add-docker-s-official-gpg-key\"><strong>3. Add Docker&rsquo;s official GPG key<\/strong><\/h3><p>Docker signs its packages with a GPG key to ensure their authenticity and integrity. Adding the official GPG key lets your system verify that the packages come directly from Docker and haven&rsquo;t been tampered with.<\/p><p>Since you&rsquo;ve already installed <strong>curl<\/strong> and created a directory for storing GPG keys, continue by running the following:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo curl -fsSL https:\/\/download.docker.com\/linux\/debian\/gpg -o \/etc\/apt\/keyrings\/docker.asc<\/pre><p>Next, <a href=\"\/in\/tutorials\/how-to-change-linux-permissions-and-owners\">update the file permissions<\/a> so the system can access the key:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo chmod a+r \/etc\/apt\/keyrings\/docker.asc<\/pre><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1ab524c406\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"58\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/terminal-docker-gpg-key-chmod-1024x58.png\" alt=\"A terminal output after adding Docker's GPG key and updating its permissions\" class=\"wp-image-127948\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-gpg-key-chmod-1024x58.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-gpg-key-chmod-300x17.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-gpg-key-chmod-150x9.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-gpg-key-chmod-768x44.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-gpg-key-chmod-1536x87.png 1536w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-gpg-key-chmod-2048x117.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-4-set-up-the-docker-repository\"><strong>4. Set up the Docker repository<\/strong><\/h3><p>By default, Debian&rsquo;s package repositories may include older versions of Docker. Use the official Docker repository instead to get the latest stable releases and security patches for all components.<\/p><p>Using the signed GPG key you added earlier, run the command below to add Docker&rsquo;s repository and configure your system to accept only trusted packages:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">echo \\\n\"deb [arch=$(dpkg --print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.asc] https:\/\/download.docker.com\/linux\/debian \\\n$(. \/etc\/os-release &amp;&amp; echo \"$VERSION_CODENAME\") stable\" | \\\nsudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null<\/pre><p>It creates a secure entry inside <strong>\/etc\/apt\/sources.list.d\/docker.list<\/strong> using the<a href=\"\/in\/tutorials\/linux-tee-command-with-examples\"> tee command<\/a>.<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1ab524ee7f\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"115\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/terminal-docker-repository-1024x115.png\" alt=\"A terminal output after setting up Docker's repository\" class=\"wp-image-127949\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-repository-1024x115.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-repository-300x34.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-repository-150x17.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-repository-768x86.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-repository-1536x173.png 1536w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-repository-2048x230.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-5-install-docker-and-its-components\"><strong>5. Install Docker and its components<\/strong><\/h3><p>Now that the repository is set up, update your package index and install Docker with its core components, such as:<\/p><ul class=\"wp-block-list\">\n<li><strong>Docker Engine<\/strong> &ndash; the core service that runs containers.<\/li>\n\n\n\n<li><strong>Docker CLI<\/strong> &ndash; the command-line interface for interacting with Docker.<\/li>\n\n\n\n<li><strong>Containerd<\/strong> &ndash; a container runtime that manages the container lifecycle.<\/li>\n\n\n\n<li><strong>Docker Buildx plugin<\/strong> &ndash; an extended tool for building Docker images.<\/li>\n\n\n\n<li><strong>Docker Compose plugin<\/strong> &ndash; a tool for running multi-container apps.<\/li>\n<\/ul><p>Update your package list with the following command:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt update<\/pre><p>Then, install Docker and its components:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/pre><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1ab5251499\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large is-resized wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"576\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/terminal-install-docker-components-1024x576.png\" alt=\"A terminal output showing the process of installing Docker and all its components\" class=\"wp-image-127950\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-install-docker-components-1024x576.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-install-docker-components-300x169.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-install-docker-components-150x84.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-install-docker-components-768x432.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-install-docker-components-1536x864.png 1536w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-install-docker-components-2048x1152.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>If you prefer to install a specific Docker version instead of the latest one, first list the available versions:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apt-cache madison docker-ce | awk '{ print $3 }'&nbsp;<\/pre><p>You should see an output showing the available version strings:<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1ab52538f2\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"445\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/terminal-docker-versions-1024x445.png\" alt=\"A terminal output showing all the available Docker versions\" class=\"wp-image-127951\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-versions-1024x445.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-versions-300x130.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-versions-150x65.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-versions-768x334.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-versions-1536x668.png 1536w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-versions.png 1744w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Set the version you want to install. For example:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">VERSION_STRING=5:28.1.0-1~debian.12~bookworm<\/pre><p>Then run:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin<\/pre><h3 class=\"wp-block-heading\" id=\"h-6-start-docker-and-enable-on-boot\"><strong>6. Start Docker and enable on boot<\/strong><\/h3><p>After installing Docker, start its service. This step is important, especially for server environments, where you want Docker to be ready as soon as the system boots.<\/p><p>Start the Docker service by executing:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl start docker<\/pre><p>Enable it to launch automatically at boot:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl enable docker<\/pre><p>To confirm that Docker is running correctly, check its status:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl status docker<\/pre><p>If Docker is running correctly, you should see an <strong>active (running)<\/strong> status for the service:<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1ab5256242\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large is-resized wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"542\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/terminal-docker-service-active-running-1024x542.png\" alt=\"A terminal output showing an active (running) status for the Docker service\" class=\"wp-image-127952\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-service-active-running-1024x542.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-service-active-running-300x159.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-service-active-running-150x79.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-service-active-running-768x406.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-service-active-running-1536x813.png 1536w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-service-active-running-2048x1083.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Hit <strong>Q<\/strong> to return to the command prompt.<\/p><h3 class=\"wp-block-heading\" id=\"h-7-verify-the-installation\"><strong>7. Verify the installation<\/strong><\/h3><p>Lastly, confirm that Docker and Docker Compose are installed correctly by running these commands:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">docker --version\n\ndocker compose version<\/pre><p>You should see the installed version numbers for both Docker Engine and Docker Compose:<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1ab5258ec7\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"212\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/terminal-docker-engine-compose-versions-1024x212.png\" alt=\"A terminal output showing the installed Docker Engine and Docker Compose versions\" class=\"wp-image-127953\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-engine-compose-versions-1024x212.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-engine-compose-versions-300x62.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-engine-compose-versions-150x31.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-engine-compose-versions-768x159.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-docker-engine-compose-versions.png 1042w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Optionally, execute the <strong>hello-world<\/strong> image to verify that Docker is up and running:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo docker run hello-world<\/pre><p>This command will download and run a test container that prints a success message, confirming that Docker is working correctly:<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1ab525b695\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"705\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2025\/05\/terminal-hello-world-image-pull-1024x705.png\" alt=\"A terminal output showing the success message of pulling the hello-world test image\" class=\"wp-image-127954\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-hello-world-image-pull-1024x705.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-hello-world-image-pull-300x206.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-hello-world-image-pull-150x103.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-hello-world-image-pull-768x528.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-hello-world-image-pull-1536x1057.png 1536w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2025\/05\/terminal-hello-world-image-pull-2048x1409.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>That&rsquo;s it! You&rsquo;ve successfully installed Docker on Debian 12. To familiarize yourself further with the platform, explore our <a href=\"\/in\/tutorials\/docker-cheat-sheet\">Docker cheat sheet<\/a>, which features the most essential commands for various tasks.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\"><strong>Conclusion<\/strong><\/h2><p>In this tutorial, we&rsquo;ve covered the steps of installing Docker on the Debian operating system. To recap, here&rsquo;s what you need to do:<\/p><ol class=\"wp-block-list\">\n<li>Update your system packages.<\/li>\n\n\n\n<li>Install prerequisite tools.<\/li>\n\n\n\n<li>Add Docker&rsquo;s official GPG key.<\/li>\n\n\n\n<li>Set up the secure Docker repository.<\/li>\n\n\n\n<li>Install Docker Engine, CLI, containerd, and the Compose plugin.<\/li>\n\n\n\n<li>Start the Docker service and enable it on boot.<\/li>\n\n\n\n<li>Verify the installation with version checks and a test container.<\/li>\n<\/ol><p>With Docker ready on your system, you can start<a href=\"\/in\/tutorials\/docker-start-a-container\"> creating containers<\/a>, running Docker commands to manage them, and exploring Docker Compose to build multi-container apps.<\/p><p>As you become more familiar with this containerized platform, you&rsquo;ll be able to deploy applications and unlock the full potential of container-based development.<\/p><h2 class=\"wp-block-heading\" id=\"h-install-docker-on-debian-faq\"><strong>Install Docker on Debian FAQ<\/strong><\/h2><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1746731313773\"><h3 class=\"schema-faq-question\"><strong>Which Debian releases can run Docker Engine?<\/strong><\/h3> <p class=\"schema-faq-answer\">According to <a href=\"https:\/\/docs.docker.com\/engine\/install\/debian\" target=\"_blank\" rel=\"noopener\">Docker&rsquo;s official documentation<\/a>, you can install Docker Engine on Debian <strong>11<\/strong> and <strong>12<\/strong>. Installing Docker on older releases like Debian <strong>10<\/strong> may still work, but we don&rsquo;t recommend it for production due to potential compatibility issues with some components.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1746731318546\"><h3 class=\"schema-faq-question\"><strong>How do I install Docker on Debian in one command?<\/strong><\/h3> <p class=\"schema-faq-answer\">You can install Docker on Debian in one command using the convenience script:<br><code>curl -fsSL https:\/\/get.docker.com -o get-docker.sh<br><\/code>But this script isn&rsquo;t recommended for production environments, as it automatically detects your distribution and configures your package without the control provided by manual installation.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1746731340461\"><h3 class=\"schema-faq-question\"><strong>How do I upgrade Docker to a newer version later?<\/strong><\/h3> <p class=\"schema-faq-answer\">Once the Docker repository is set up, check for updates by using:<br><code>apt list --upgradable<\/code><br>If a newer version of Docker appears on the list, upgrade it with:<br><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1746731406496\"><h3 class=\"schema-faq-question\"><strong>How do I uninstall Docker on Debian?<\/strong><\/h3> <p class=\"schema-faq-answer\">To uninstall Docker, first remove the Docker packages:<br><code>sudo apt purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras<br><\/code>Then ,<a href=\"\/in\/tutorials\/how-to-remove-docker-images\">delete all Docker images<\/a>, containers, and volumes:<br><code>sudo rm -rf \/var\/lib\/docker<br>sudo rm -rf \/var\/lib\/containerd<br><\/code>Finally, remove the source list and keyrings:<br><code>sudo rm \/etc\/apt\/sources.list.d\/docker.list<br>sudo rm \/etc\/apt\/keyrings\/docker.asc<\/code><\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>As a containerized platform, Docker lets you develop and run apps in isolated environments without modifying your system. Developers and sysadmins also use it to test experimental code. If something breaks during testing, it won&rsquo;t affect the rest of your setup. Meanwhile, Debian is a Linux distribution known for its rock-solid stability, making it a [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/in\/tutorials\/how-to-install-docker-debian\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":411,"featured_media":64047,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"","rank_math_description":"","rank_math_focus_keyword":"","footnotes":""},"categories":[22642,22640],"tags":[],"class_list":["post-127940","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pre-installed-applications","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-install-docker-debian","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-install-docker-debian","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-install-docker-debian","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-install-docker-debian","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-install-docker-debian","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-install-docker-debian","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-install-docker-debian","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-install-docker-debian","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/127940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/users\/411"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/comments?post=127940"}],"version-history":[{"count":7,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/127940\/revisions"}],"predecessor-version":[{"id":127986,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/127940\/revisions\/127986"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media\/64047"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media?parent=127940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/categories?post=127940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/tags?post=127940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}