<nav id="breadcrumbs" data-pagefind-ignore="" class="breadcrumbs mb-4 flex min-w-0 items-center gap-2 text-gray-400 dark:text-gray-300"><a href="https://docs.docker.com/" class="link truncate">Home</a>
<span>/</span>
<a href="https://docs.docker.com/manuals/" class="link truncate">Manuals</a>
<span>/</span>
<a href="https://docs.docker.com/engine/" class="link truncate">Docker Engine</a>
<span>/</span>
<a href="https://docs.docker.com/engine/install/" class="link truncate">Install</a>
<span>/</span>
<span data-pagefind-meta="breadcrumbs:Home / Manuals / Docker Engine / Install" class="truncate">Debian</span></nav><div class="flex items-start justify-between"><h1 data-pagefind-weight="10">Install Docker Engine on Debian</h1><div class="md-dropdown ml-auto hidden lg:block"><details id="markdownDropdown" class="ml-3 group relative z-10 inline-block" data-heap-id="markdown-dropdown"><summary class="dropdown-base hover:bg-gray-50 dark:hover:bg-gray-900 inline-flex cursor-pointer items-center gap-0 py-1 pl-2 text-sm font-semibold transition-colors" data-heap-id="markdown-dropdown-toggle"><span class="font-normal">Page options</span>
<span class="icon-svg transition-transform group-open:rotate-180"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M464-376 306-533q-2-2-3.5-4.76-1.5-2.77-1.5-5.92.0-6.32 4.13-10.82 4.12-4.5 10.87-4.5h328q6.75.0 10.88 4.64 4.12 4.63 4.12 10.81.0 1.55-5 10.55L496-376q-3 3-7.06 5t-8.94 2q-4.87.0-8.94-2-4.06-2-7.06-5z"></path></svg>
</span><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></summary><div class="dropdown-base absolute right-0 z-50 mt-1 w-65 origin-top-right p-2 text-sm shadow-md [display:none] group-open:[display:block]" data-heap-id="markdown-dropdown-menu"><button onclick="copyMarkdown()" data-heap-id="copy-markdown-button" class="sub-button">
<span class="icon-svg mt-[2px] text-base leading-none"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg>
</span><span class="icon-svg hidden mt-[2px] text-base leading-none"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span><div class="leading-tight"><div class="text-base">Copy page as Markdown for LLMs</div></div></button>
<button onclick="viewPlainText()" data-heap-id="view-markdown-button" class="sub-button">
<span class="icon-svg mt-[2px] text-base leading-none"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M349-250h262q12.75.0 21.38-8.68 8.62-8.67 8.62-21.5.0-12.82-8.62-21.32-8.63-8.5-21.38-8.5H349q-12.75.0-21.37 8.68-8.63 8.67-8.63 21.5.0 12.82 8.63 21.32 8.62 8.5 21.37 8.5zm0-170h262q12.75.0 21.38-8.68 8.62-8.67 8.62-21.5.0-12.82-8.62-21.32-8.63-8.5-21.38-8.5H349q-12.75.0-21.37 8.68-8.63 8.67-8.63 21.5.0 12.82 8.63 21.32 8.62 8.5 21.37 8.5zM220-80q-24 0-42-18t-18-42v-680q0-24 18-42t42-18h336q12.44.0 23.72 5T599-862l183 183q8 8 13 19.28t5 23.72v496q0 24-18 42t-42 18H220zm331-584q0 12.75 8.63 21.37Q568.25-634 581-634h159L551-820v156z"></path></svg></span><div class="leading-tight"><div class="text-base">View page as plain text</div></div></button>
<button onclick="openInDocsAI()" data-heap-id="search-docs-ai-button" class="sub-button">
<span class="icon-svg mt-[2px] text-base leading-none"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M378-329q-108.16.0-183.08-75Q120-479 120-585t75-181 181.5-75 181 75T632-584.85Q632-542 618-502t-42 75l242 240q9 8.56 9 21.78T818-143t-22.22 9-21.78-9L533-384q-30 26-69.96 40.5Q423.08-329 378-329zm-1-60q81.25.0 138.13-57.5Q572-504 572-585t-56.87-138.5Q458.25-781 377-781q-82.08.0-139.54 57.5T180-585t57.46 138.5T377-389z"></path></svg></span><div class="leading-tight"><div class="text-base">Ask questions with Docs AI</div></div></button>
<button onclick="openInClaude()" data-heap-id="search-docs-ai-button" class="sub-button">
<span class="icon-svg mt-[2px] text-base leading-none"><svg fill="currentcolor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em"><title>Claude</title><path d="M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97.0 01-.104-.729L6.283.134 6.696.0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"></path></svg></span><div class="leading-tight"><div class="text-base">Open in Claude</div></div></button></div></details><script>function getCurrentPlaintextUrl(){const e=window.location.href.split("#")[0].replace(/\/$/,"");return`${e}/index.md`}function copyMarkdown(){fetch(getCurrentPlaintextUrl()).then(e=>e.text()).then(e=>{navigator.clipboard.writeText(e).then(()=>{const e=document.querySelector('[data-heap-id="copy-markdown-button"]');if(!e)return;const t=e.querySelectorAll(".icon-svg"),n=t[0],s=t[1];n.classList.add("hidden"),s.classList.remove("hidden"),setTimeout(()=>{n.classList.remove("hidden"),s.classList.add("hidden")},2e3)})}).catch(e=>{console.error("Error copying markdown:",e)})}function viewPlainText(){window.open(getCurrentPlaintextUrl(),"_blank")}function openInDocsAI(){const e=document.querySelector(".open-kapa-widget");e?e.click():alert("Couldn't find Docs AI.")}function openInClaude(){const e=getCurrentPlaintextUrl(),t=`Read ${e} so I can ask questions about it.`,n=encodeURIComponent(t),s=`https://claude.ai/new?q=${n}`;window.open(s,"_blank")}</script></div></div><div class="block lg:hidden"><div data-pagefind-ignore="" class="not-prose"><div class="pb-0 text-lg lg:pb-2">Table of contents</div><nav class="toc"><ul class="pl-2"><li><a class="link lg:no-underline" href="#prerequisites">Prerequisites</a></li><ul class="pl-2"><li><a class="link lg:no-underline" href="#firewall-limitations">Firewall limitations</a></li><li><a class="link lg:no-underline" href="#os-requirements">OS requirements</a></li><li><a class="link lg:no-underline" href="#uninstall-old-versions">Uninstall old versions</a></li></ul><li><a class="link lg:no-underline" href="#installation-methods">Installation methods</a></li><ul class="pl-2"><li><a class="link lg:no-underline" href="#install-using-the-repository">Install using the <code>apt</code> repository</a></li><ul class="pl-2"><li><a class="link lg:no-underline" href="#upgrade-docker-engine">Upgrade Docker Engine</a></li></ul><li><a class="link lg:no-underline" href="#install-from-a-package">Install from a package</a></li><ul class="pl-2"><li><a class="link lg:no-underline" href="#upgrade-docker-engine-1">Upgrade Docker Engine</a></li></ul><li><a class="link lg:no-underline" href="#install-using-the-convenience-script">Install using the convenience script</a></li><ul class="pl-2"><li><a class="link lg:no-underline" href="#install-pre-releases">Install pre-releases</a></li><li><a class="link lg:no-underline" href="#upgrade-docker-after-using-the-convenience-script">Upgrade Docker after using the convenience script</a></li></ul></ul><li><a class="link lg:no-underline" href="#uninstall-docker-engine">Uninstall Docker Engine</a></li><li><a class="link lg:no-underline" href="#next-steps">Next steps</a></li></ul></nav></div><hr></div><p>To get started with Docker Engine on Debian, make sure you
<a class="link" href="#prerequisites">meet the prerequisites</a>, and then follow the
<a class="link" href="#installation-methods">installation steps</a>.</p><h2 class="scroll-mt-20" id="prerequisites"><a class="text-black dark:text-white no-underline hover:underline" href="#prerequisites">Prerequisites</a></h2><h3 class="scroll-mt-20" id="firewall-limitations"><a class="text-black dark:text-white no-underline hover:underline" href="#firewall-limitations">Firewall limitations</a></h3><blockquote class="admonition admonition-warning admonition not-prose"><div class="admonition-header"><span class="admonition-icon"><svg width="24" height="24" viewBox="0 0 24 24" fill="none"><mask id="mask0_5432_2018" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="2" width="24" height="21"><path d="M11.9998 9.99999V14m0 4H12.0098M10.6151 4.89171 2.39019 19.0983c-.45621.788-.68431 1.182-.6506 1.5054C1.769 20.8857 1.91677 21.142 2.14613 21.3088 2.40908 21.5 2.86435 21.5 3.77487 21.5H20.2246C21.1352 21.5 21.5904 21.5 21.8534 21.3088 22.0827 21.142 22.2305 20.8857 22.2599 20.6037 22.2936 20.2803 22.0655 19.8863 21.6093 19.0983L13.3844 4.89171C12.9299 4.10654 12.7026 3.71396 12.4061 3.58211c-.258700000000001-.11501-.554-.11501-.8126.0C11.2969 3.71396 11.0696 4.10655 10.6151 4.89171z" stroke="#6c7e9d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></mask><g mask="url(#mask0_5432_2018)"><rect width="24" height="24" fill="currentcolor" fill-opacity=".8"></rect></g></svg>
</span><span class="admonition-title">Warning</span></div><div class="admonition-content"><p>Before you install Docker, make sure you consider the following
security implications and firewall incompatibilities.</p></div></blockquote><ul><li>If you use ufw or firewalld to manage firewall settings, be aware that
when you expose container ports using Docker, these ports bypass your
firewall rules. For more information, refer to
<a class="link" href="https://docs.docker.com/engine/network/packet-filtering-firewalls/#docker-and-ufw">Docker and ufw</a>.</li><li>Docker is only compatible with <code>iptables-nft</code> and <code>iptables-legacy</code>.
Firewall rules created with <code>nft</code> are not supported on a system with Docker installed.
Make sure that any firewall rulesets you use are created with <code>iptables</code> or <code>ip6tables</code>,
and that you add them to the <code>DOCKER-USER</code> chain,
see
<a class="link" href="https://docs.docker.com/engine/network/packet-filtering-firewalls/">Packet filtering and firewalls</a>.</li></ul><h3 class="scroll-mt-20" id="os-requirements"><a class="text-black dark:text-white no-underline hover:underline" href="#os-requirements">OS requirements</a></h3><p>To install Docker Engine, you need the 64-bit version of one of these Debian
versions:</p><ul><li>Debian Trixie 13 (testing)</li><li>Debian Bookworm 12 (stable)</li><li>Debian Bullseye 11 (oldstable)</li></ul><p>Docker Engine for Debian is compatible with x86_64 (or amd64), armhf, arm64,
and ppc64le (ppc64el) architectures.</p><h3 class="scroll-mt-20" id="uninstall-old-versions"><a class="text-black dark:text-white no-underline hover:underline" href="#uninstall-old-versions">Uninstall old versions</a></h3><p>Before you can install Docker Engine, you need to uninstall any conflicting packages.</p><p>Your Linux distribution may provide unofficial Docker packages, which may conflict
with the official packages provided by Docker. You must uninstall these packages
before you install the official version of Docker Engine.</p><p>The unofficial packages to uninstall are:</p><ul><li><code>docker.io</code></li><li><code>docker-compose</code></li><li><code>docker-doc</code></li><li><code>podman-docker</code></li></ul><p>Moreover, Docker Engine depends on <code>containerd</code> and <code>runc</code>. Docker Engine
bundles these dependencies as one bundle: <code>containerd.io</code>. If you have
installed the <code>containerd</code> or <code>runc</code> previously, uninstall them to avoid
conflicts with the versions bundled with Docker Engine.</p><p>Run the following command to uninstall all conflicting packages:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBmb3IgcGtnIGluIGRvY2tlci5pbyBkb2NrZXItZG9jIGRvY2tlci1jb21wb3NlIHBvZG1hbi1kb2NrZXIgY29udGFpbmVyZCBydW5jOyBkbyBzdWRvIGFwdC1nZXQgcmVtb3ZlICRwa2c7IGRvbmU=', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> <span class="k">for</span> pkg in docker.io docker-doc docker-compose podman-docker containerd runc<span class="p">;</span> <span class="k">do</span> sudo apt-get remove <span class="nv">$pkg</span><span class="p">;</span> <span class="k">done</span>
</span></span></code></pre></div></div></div></div><p><code>apt-get</code> might report that you have none of these packages installed.</p><p>Images, containers, volumes, and networks stored in <code>/var/lib/docker/</code> aren't
automatically removed when you uninstall Docker. If you want to start with a
clean installation, and prefer to clean up any existing data, read the
<a class="link" href="#uninstall-docker-engine">uninstall Docker Engine</a> section.</p><h2 class="scroll-mt-20" id="installation-methods"><a class="text-black dark:text-white no-underline hover:underline" href="#installation-methods">Installation methods</a></h2><p>You can install Docker Engine in different ways, depending on your needs:</p><ul><li><p>Docker Engine comes bundled with
<a class="link" href="https://docs.docker.com/desktop/setup/install/linux/">Docker Desktop for Linux</a>. This is
the easiest and quickest way to get started.</p></li><li><p>Set up and install Docker Engine from
<a class="link" href="#install-using-the-repository">Docker's <code>apt</code> repository</a>.</p></li><li><p><a class="link" href="#install-from-a-package">Install it manually</a> and manage upgrades manually.</p></li><li><p>Use a <a class="link" href="#install-using-the-convenience-script">convenience script</a>. Only
recommended for testing and development environments.</p></li></ul><h3 class="scroll-mt-20" id="install-using-the-repository"><a class="text-black dark:text-white no-underline hover:underline" href="#install-using-the-repository">Install using the <code>apt</code> repository</a></h3><p>Before you install Docker Engine for the first time on a new host machine, you
need to set up the Docker <code>apt</code> repository. Afterward, you can install and update
Docker from the repository.</p><ol><li><p>Set up Docker's <code>apt</code> repository.</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: ' ', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Add Docker's official GPG key:</span>
</span></span><span class="line"><span class="cl">sudo apt-get update
</span></span><span class="line"><span class="cl">sudo apt-get install ca-certificates curl
</span></span><span class="line"><span class="cl">sudo install -m <span class="m">0755</span> -d /etc/apt/keyrings
</span></span><span class="line"><span class="cl">sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
</span></span><span class="line"><span class="cl">sudo chmod a+r /etc/apt/keyrings/docker.asc
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Add the repository to Apt sources:</span>
</span></span><span class="line"><span class="cl"><span class="nb">echo</span> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>  <span class="s2">"deb [arch=</span><span class="k">$(</span>dpkg --print-architecture<span class="k">)</span><span class="s2"> signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
</span></span></span><span class="line"><span class="cl"><span class="s2">  </span><span class="k">$(</span>. /etc/os-release <span class="o">&amp;&amp;</span> <span class="nb">echo</span> <span class="s2">"</span><span class="nv">$VERSION_CODENAME</span><span class="s2">"</span><span class="k">)</span><span class="s2"> stable"</span> <span class="p">|</span> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>  sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null
</span></span><span class="line"><span class="cl">sudo apt-get update</span></span></code></pre></div></div></div></div><blockquote class="admonition admonition-note admonition not-prose"><div class="admonition-header"><span class="admonition-icon"><svg width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M12 16V12m0-4H12.01M22 12c0 5.5228-4.4772 10-10 10C6.47715 22 2 17.5228 2 12 2 6.47715 6.47715 2 12 2c5.5228.0 10 4.47715 10 10z" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
</span><span class="admonition-title">Note</span></div><div class="admonition-content"><p>If you use a derivative distribution, such as Kali Linux,
you may need to substitute the part of this command that's expected to
print the version codename:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCguIC9ldGMvb3MtcmVsZWFzZSAmJiBlY2hvICIkVkVSU0lPTl9DT0RFTkFNRSIp', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span><span class="o">(</span>. /etc/os-release <span class="o">&amp;&amp;</span> <span class="nb">echo</span> <span class="s2">"</span><span class="nv">$VERSION_CODENAME</span><span class="s2">"</span><span class="o">)</span>
</span></span></code></pre></div></div></div></div><p>Replace this part with the codename of the corresponding Debian release,
such as <code>bookworm</code>.</p></div></blockquote></li><li><p>Install the Docker packages.</p><div class="tabs" x-data="{ selected: 'Latest' }" aria-role="tabpanel"><div aria-role="tablist" class="tablist"><button class="tab-item border-blue border-b-4 dark:border-b-blue-600" :class="selected === 'Latest' &amp;&amp;
          'border-blue border-b-4 dark:border-b-blue-600'" @click="selected = 'Latest'">
Latest
</button>
<button class="tab-item" :class="selected === 'Specific-version' &amp;&amp;
          'border-blue border-b-4 dark:border-b-blue-600'" @click="selected = 'Specific-version'">
Specific version</button></div><div><div aria-role="tab" :class="selected !== 'Latest' &amp;&amp; 'hidden'" class=""><p>To install the latest version, run:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBzdWRvIGFwdC1nZXQgaW5zdGFsbCBkb2NrZXItY2UgZG9ja2VyLWNlLWNsaSBjb250YWluZXJkLmlvIGRvY2tlci1idWlsZHgtcGx1Z2luIGRvY2tlci1jb21wb3NlLXBsdWdpbg==', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
</span></span></code></pre></div></div></div></div></div><div aria-role="tab" :class="selected !== 'Specific-version' &amp;&amp; 'hidden'" class="hidden"><p>To install a specific version of Docker Engine, start by listing the
available versions in the repository:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'IyBMaXN0IHRoZSBhdmFpbGFibGUgdmVyc2lvbnM6CiQgYXB0LWNhY2hlIG1hZGlzb24gZG9ja2VyLWNlIHwgYXdrICd7IHByaW50ICQzIH0nCgo1OjI4LjMuMy0xfmRlYmlhbi4xMn5ib29rd29ybQo1OjI4LjMuMi0xfmRlYmlhbi4xMn5ib29rd29ybQouLi4=', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">#</span> List the available versions:
</span></span><span class="line"><span class="cl"><span class="gp">$</span> apt-cache madison docker-ce <span class="p">|</span> awk <span class="s1">'{ print $3 }'</span>
</span></span><span class="line"><span class="cl"><span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span><span class="go">5:28.3.3-1~debian.12~bookworm
</span></span></span><span class="line"><span class="cl"><span class="go">5:28.3.2-1~debian.12~bookworm
</span></span></span><span class="line"><span class="cl"><span class="go">...
</span></span></span></code></pre></div></div></div></div><p>Select the desired version and install:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBWRVJTSU9OX1NUUklORz01OjI4LjMuMy0xfmRlYmlhbi4xMn5ib29rd29ybQokIHN1ZG8gYXB0LWdldCBpbnN0YWxsIGRvY2tlci1jZT0kVkVSU0lPTl9TVFJJTkcgZG9ja2VyLWNlLWNsaT0kVkVSU0lPTl9TVFJJTkcgY29udGFpbmVyZC5pbyBkb2NrZXItYnVpbGR4LXBsdWdpbiBkb2NrZXItY29tcG9zZS1wbHVnaW4=', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> <span class="nv">VERSION_STRING</span><span class="o">=</span>5:28.3.3-1~debian.12~bookworm
</span></span><span class="line"><span class="cl"><span class="gp">$</span> sudo apt-get install docker-ce<span class="o">=</span><span class="nv">$VERSION_STRING</span> docker-ce-cli<span class="o">=</span><span class="nv">$VERSION_STRING</span> containerd.io docker-buildx-plugin docker-compose-plugin
</span></span></code></pre></div></div></div></div></div></div></div></li><li><p>Verify that the installation is successful by running the <code>hello-world</code> image:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBzdWRvIGRvY2tlciBydW4gaGVsbG8td29ybGQ=', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> sudo docker run hello-world
</span></span></code></pre></div></div></div></div><p>This command downloads a test image and runs it in a container. When the
container runs, it prints a confirmation message and exits.</p></li></ol><p>You have now successfully installed and started Docker Engine.</p><blockquote class="admonition admonition-tip admonition not-prose"><div class="admonition-header"><span class="admonition-icon"><svg width="24" height="24" viewBox="0 0 24 24" fill="none"><mask id="mask0_5432_1749" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="4" y="1" width="17" height="22"><path d="M9.93896 22H14.939m-4.5-12h4m-2 0v6m3-.6736c2.3649-1.1235 4-3.534 4-6.3264.0-3.86599-3.134-7-7-7C8.57297 2 5.43896 5.13401 5.43896 9c0 2.7924 1.63506 5.2029 4 6.3264V16c0 .931899999999999.0 1.3978.15225 1.7654C9.79419 18.2554 10.1835 18.6448 10.6736 18.8478 11.0411 19 11.5071 19 12.439 19 13.3708 19 13.8368 19 14.2043 18.8478 14.6944 18.6448 15.0837 18.2554 15.2867 17.7654 15.439 17.3978 15.439 16.9319 15.439 16v-.6736z" stroke="#6c7e9d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></mask><g mask="url(#mask0_5432_1749)"><rect width="24" height="24" fill="currentcolor" fill-opacity=".8"></rect></g></svg>
</span><span class="admonition-title">Tip</span></div><div class="admonition-content"><p>Receiving errors when trying to run without root?</p><p>The <code>docker</code> user group exists but contains no users, which is why you’re required
to use <code>sudo</code> to run Docker commands. Continue to
<a class="link" href="/engine/install/linux-postinstall">Linux postinstall</a>
to allow non-privileged users to run Docker commands and for other optional configuration steps.</p></div></blockquote><h4 class="scroll-mt-20" id="upgrade-docker-engine"><a class="text-black dark:text-white no-underline hover:underline" href="#upgrade-docker-engine">Upgrade Docker Engine</a></h4><p>To upgrade Docker Engine, follow step 2 of the
<a class="link" href="#install-using-the-repository">installation instructions</a>,
choosing the new version you want to install.</p><h3 class="scroll-mt-20" id="install-from-a-package"><a class="text-black dark:text-white no-underline hover:underline" href="#install-from-a-package">Install from a package</a></h3><p>If you can't use Docker's <code>apt</code> repository to install Docker Engine, you can
download the <code>deb</code> file for your release and install it manually. You need to
download a new file each time you want to upgrade Docker Engine.</p><ol><li><p>Go to <a class="link" href="https://download.docker.com/linux/debian/dists/" rel="noopener"><code>https://download.docker.com/linux/debian/dists/</code></a>.</p></li><li><p>Select your Debian version in the list.</p></li><li><p>Go to <code>pool/stable/</code> and select the applicable architecture (<code>amd64</code>,
<code>armhf</code>, <code>arm64</code>, or <code>s390x</code>).</p></li><li><p>Download the following <code>deb</code> files for the Docker Engine, CLI, containerd,
and Docker Compose packages:</p><ul><li><code>containerd.io_&lt;version&gt;_&lt;arch&gt;.deb</code></li><li><code>docker-ce_&lt;version&gt;_&lt;arch&gt;.deb</code></li><li><code>docker-ce-cli_&lt;version&gt;_&lt;arch&gt;.deb</code></li><li><code>docker-buildx-plugin_&lt;version&gt;_&lt;arch&gt;.deb</code></li><li><code>docker-compose-plugin_&lt;version&gt;_&lt;arch&gt;.deb</code></li></ul></li><li><p>Install the <code>.deb</code> packages. Update the paths in the following example to
where you downloaded the Docker packages.</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBzdWRvIGRwa2cgLWkgLi9jb250YWluZXJkLmlvXzx2ZXJzaW9uPl88YXJjaD4uZGViIFwKICAuL2RvY2tlci1jZV88dmVyc2lvbj5fPGFyY2g+LmRlYiBcCiAgLi9kb2NrZXItY2UtY2xpXzx2ZXJzaW9uPl88YXJjaD4uZGViIFwKICAuL2RvY2tlci1idWlsZHgtcGx1Z2luXzx2ZXJzaW9uPl88YXJjaD4uZGViIFwKICAuL2RvY2tlci1jb21wb3NlLXBsdWdpbl88dmVyc2lvbj5fPGFyY2g+LmRlYg==', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> sudo dpkg -i ./containerd.io_&lt;version&gt;_&lt;arch&gt;.deb <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span><span class="go">  ./docker-ce_&lt;version&gt;_&lt;arch&gt;.deb \
</span></span></span><span class="line"><span class="cl"><span class="go">  ./docker-ce-cli_&lt;version&gt;_&lt;arch&gt;.deb \
</span></span></span><span class="line"><span class="cl"><span class="go">  ./docker-buildx-plugin_&lt;version&gt;_&lt;arch&gt;.deb \
</span></span></span><span class="line"><span class="cl"><span class="go">  ./docker-compose-plugin_&lt;version&gt;_&lt;arch&gt;.deb
</span></span></span></code></pre></div></div></div></div><p>The Docker daemon starts automatically.</p></li><li><p>Verify that the installation is successful by running the <code>hello-world</code> image:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBzdWRvIHNlcnZpY2UgZG9ja2VyIHN0YXJ0CiQgc3VkbyBkb2NrZXIgcnVuIGhlbGxvLXdvcmxk', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> sudo service docker start
</span></span><span class="line"><span class="cl"><span class="gp">$</span> sudo docker run hello-world
</span></span></code></pre></div></div></div></div><p>This command downloads a test image and runs it in a container. When the
container runs, it prints a confirmation message and exits.</p></li></ol><p>You have now successfully installed and started Docker Engine.</p><blockquote class="admonition admonition-tip admonition not-prose"><div class="admonition-header"><span class="admonition-icon"><svg width="24" height="24" viewBox="0 0 24 24" fill="none"><mask id="mask0_5432_1749" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="4" y="1" width="17" height="22"><path d="M9.93896 22H14.939m-4.5-12h4m-2 0v6m3-.6736c2.3649-1.1235 4-3.534 4-6.3264.0-3.86599-3.134-7-7-7C8.57297 2 5.43896 5.13401 5.43896 9c0 2.7924 1.63506 5.2029 4 6.3264V16c0 .931899999999999.0 1.3978.15225 1.7654C9.79419 18.2554 10.1835 18.6448 10.6736 18.8478 11.0411 19 11.5071 19 12.439 19 13.3708 19 13.8368 19 14.2043 18.8478 14.6944 18.6448 15.0837 18.2554 15.2867 17.7654 15.439 17.3978 15.439 16.9319 15.439 16v-.6736z" stroke="#6c7e9d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></mask><g mask="url(#mask0_5432_1749)"><rect width="24" height="24" fill="currentcolor" fill-opacity=".8"></rect></g></svg>
</span><span class="admonition-title">Tip</span></div><div class="admonition-content"><p>Receiving errors when trying to run without root?</p><p>The <code>docker</code> user group exists but contains no users, which is why you’re required
to use <code>sudo</code> to run Docker commands. Continue to
<a class="link" href="/engine/install/linux-postinstall">Linux postinstall</a>
to allow non-privileged users to run Docker commands and for other optional configuration steps.</p></div></blockquote><h4 class="scroll-mt-20" id="upgrade-docker-engine-1"><a class="text-black dark:text-white no-underline hover:underline" href="#upgrade-docker-engine-1">Upgrade Docker Engine</a></h4><p>To upgrade Docker Engine, download the newer package files and repeat the
<a class="link" href="#install-from-a-package">installation procedure</a>, pointing to the new files.</p><h3 class="scroll-mt-20" id="install-using-the-convenience-script"><a class="text-black dark:text-white no-underline hover:underline" href="#install-using-the-convenience-script">Install using the convenience script</a></h3><p>Docker provides a convenience script at
<a class="link" href="https://get.docker.com/" rel="noopener">https://get.docker.com/</a> to install Docker into
development environments non-interactively. The convenience script isn't
recommended for production environments, but it's useful for creating a
provisioning script tailored to your needs. Also refer to the
<a class="link" href="#install-using-the-repository">install using the repository</a> steps to learn
about installation steps to install using the package repository. The source code
for the script is open source, and you can find it in the
<a class="link" href="https://github.com/docker/docker-install" rel="noopener"><code>docker-install</code> repository on GitHub</a>.</p><p>Always examine scripts downloaded from the internet before running them locally.
Before installing, make yourself familiar with potential risks and limitations
of the convenience script:</p><ul><li>The script requires <code>root</code> or <code>sudo</code> privileges to run.</li><li>The script attempts to detect your Linux distribution and version and
configure your package management system for you.</li><li>The script doesn't allow you to customize most installation parameters.</li><li>The script installs dependencies and recommendations without asking for
confirmation. This may install a large number of packages, depending on the
current configuration of your host machine.</li><li>By default, the script installs the latest stable release of Docker,
containerd, and runc. When using this script to provision a machine, this may
result in unexpected major version upgrades of Docker. Always test upgrades in
a test environment before deploying to your production systems.</li><li>The script isn't designed to upgrade an existing Docker installation. When
using the script to update an existing installation, dependencies may not be
updated to the expected version, resulting in outdated versions.</li></ul><blockquote class="admonition admonition-tip admonition not-prose"><div class="admonition-header"><span class="admonition-icon"><svg width="24" height="24" viewBox="0 0 24 24" fill="none"><mask id="mask0_5432_1749" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="4" y="1" width="17" height="22"><path d="M9.93896 22H14.939m-4.5-12h4m-2 0v6m3-.6736c2.3649-1.1235 4-3.534 4-6.3264.0-3.86599-3.134-7-7-7C8.57297 2 5.43896 5.13401 5.43896 9c0 2.7924 1.63506 5.2029 4 6.3264V16c0 .931899999999999.0 1.3978.15225 1.7654C9.79419 18.2554 10.1835 18.6448 10.6736 18.8478 11.0411 19 11.5071 19 12.439 19 13.3708 19 13.8368 19 14.2043 18.8478 14.6944 18.6448 15.0837 18.2554 15.2867 17.7654 15.439 17.3978 15.439 16.9319 15.439 16v-.6736z" stroke="#6c7e9d" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></mask><g mask="url(#mask0_5432_1749)"><rect width="24" height="24" fill="currentcolor" fill-opacity=".8"></rect></g></svg>
</span><span class="admonition-title">Tip</span></div><div class="admonition-content"><p>Preview script steps before running. You can run the script with the <code>--dry-run</code> option to learn what steps the
script will run when invoked:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBjdXJsIC1mc1NMIGh0dHBzOi8vZ2V0LmRvY2tlci5jb20gLW8gZ2V0LWRvY2tlci5zaAokIHN1ZG8gc2ggLi9nZXQtZG9ja2VyLnNoIC0tZHJ5LXJ1bg==', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> curl -fsSL https://get.docker.com -o get-docker.sh
</span></span><span class="line"><span class="cl"><span class="gp">$</span> sudo sh ./get-docker.sh --dry-run
</span></span></code></pre></div></div></div></div></div></blockquote><p>This example downloads the script from
<a class="link" href="https://get.docker.com/" rel="noopener">https://get.docker.com/</a> and runs it to install the
latest stable release of Docker on Linux:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBjdXJsIC1mc1NMIGh0dHBzOi8vZ2V0LmRvY2tlci5jb20gLW8gZ2V0LWRvY2tlci5zaAokIHN1ZG8gc2ggZ2V0LWRvY2tlci5zaApFeGVjdXRpbmcgZG9ja2VyIGluc3RhbGwgc2NyaXB0LCBjb21taXQ6IDdjYWU1ZjhiMGRlY2MxN2Q2NTcxZjlmNTJlYjg0MGZiYzEzYjI3MzcKPC4uLj4=', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> curl -fsSL https://get.docker.com -o get-docker.sh
</span></span><span class="line"><span class="cl"><span class="gp">$</span> sudo sh get-docker.sh
</span></span><span class="line"><span class="cl"><span class="go">Executing docker install script, commit: 7cae5f8b0decc17d6571f9f52eb840fbc13b2737
</span></span></span><span class="line"><span class="cl"><span class="go">&lt;...&gt;
</span></span></span></code></pre></div></div></div></div><p>You have now successfully installed and started Docker Engine. The <code>docker</code>
service starts automatically on Debian based distributions. On <code>RPM</code> based
distributions, such as CentOS, Fedora, RHEL or SLES, you need to start it
manually using the appropriate <code>systemctl</code> or <code>service</code> command. As the message
indicates, non-root users can't run Docker commands by default.</p><blockquote class="admonition not-prose"><p><strong>Use Docker as a non-privileged user, or install in rootless mode?</strong></p><p>The installation script requires <code>root</code> or <code>sudo</code> privileges to install and
use Docker. If you want to grant non-root users access to Docker, refer to the
<a class="link" href="/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user">post-installation steps for Linux</a>.
You can also install Docker without <code>root</code> privileges, or configured to run in
rootless mode. For instructions on running Docker in rootless mode, refer to
<a class="link" href="/engine/security/rootless/">run the Docker daemon as a non-root user (rootless mode)</a>.</p></blockquote><h4 class="scroll-mt-20" id="install-pre-releases"><a class="text-black dark:text-white no-underline hover:underline" href="#install-pre-releases">Install pre-releases</a></h4><p>Docker also provides a convenience script at
<a class="link" href="https://test.docker.com/" rel="noopener">https://test.docker.com/</a> to install pre-releases of
Docker on Linux. This script is equal to the script at <code>get.docker.com</code>, but
configures your package manager to use the test channel of the Docker package
repository. The test channel includes both stable and pre-releases (beta
versions, release-candidates) of Docker. Use this script to get early access to
new releases, and to evaluate them in a testing environment before they're
released as stable.</p><p>To install the latest version of Docker on Linux from the test channel, run:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBjdXJsIC1mc1NMIGh0dHBzOi8vdGVzdC5kb2NrZXIuY29tIC1vIHRlc3QtZG9ja2VyLnNoCiQgc3VkbyBzaCB0ZXN0LWRvY2tlci5zaA==', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> curl -fsSL https://test.docker.com -o test-docker.sh
</span></span><span class="line"><span class="cl"><span class="gp">$</span> sudo sh test-docker.sh
</span></span></code></pre></div></div></div></div><h4 class="scroll-mt-20" id="upgrade-docker-after-using-the-convenience-script"><a class="text-black dark:text-white no-underline hover:underline" href="#upgrade-docker-after-using-the-convenience-script">Upgrade Docker after using the convenience script</a></h4><p>If you installed Docker using the convenience script, you should upgrade Docker
using your package manager directly. There's no advantage to re-running the
convenience script. Re-running it can cause issues if it attempts to re-install
repositories which already exist on the host machine.</p><h2 class="scroll-mt-20" id="uninstall-docker-engine"><a class="text-black dark:text-white no-underline hover:underline" href="#uninstall-docker-engine">Uninstall Docker Engine</a></h2><ol><li><p>Uninstall the Docker Engine, CLI, containerd, and Docker Compose packages:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBzdWRvIGFwdC1nZXQgcHVyZ2UgZG9ja2VyLWNlIGRvY2tlci1jZS1jbGkgY29udGFpbmVyZC5pbyBkb2NrZXItYnVpbGR4LXBsdWdpbiBkb2NrZXItY29tcG9zZS1wbHVnaW4gZG9ja2VyLWNlLXJvb3RsZXNzLWV4dHJhcw==', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
</span></span></code></pre></div></div></div></div></li><li><p>Images, containers, volumes, or custom configuration files on your host
aren't automatically removed. To delete all images, containers, and volumes:</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBzdWRvIHJtIC1yZiAvdmFyL2xpYi9kb2NrZXIKJCBzdWRvIHJtIC1yZiAvdmFyL2xpYi9jb250YWluZXJk', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> sudo rm -rf /var/lib/docker
</span></span><span class="line"><span class="cl"><span class="gp">$</span> sudo rm -rf /var/lib/containerd
</span></span></code></pre></div></div></div></div></li><li><p>Remove source list and keyrings</p><div data-pagefind-ignore="" x-data="" x-ref="root" class="group mt-2 mb-4 flex w-full scroll-mt-2 flex-col items-start gap-4 rounded bg-gray-50 p-2 outline outline-1 outline-offset-[-1px] outline-gray-200 dark:bg-gray-900 dark:outline-gray-800"><div class="relative w-full"><div class="syntax-light dark:syntax-dark not-prose w-full"><button x-data="{ code: 'JCBzdWRvIHJtIC9ldGMvYXB0L3NvdXJjZXMubGlzdC5kL2RvY2tlci5saXN0CiQgc3VkbyBybSAvZXRjL2FwdC9rZXlyaW5ncy9kb2NrZXIuYXNj', copying: false }" class="top-1
absolute right-2 z-10 text-gray-300 dark:text-gray-500" title="copy" @click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^[\$&gt;]\s+/gm, ''));
      copying = true;
      setTimeout(() =&gt; copying = false, 2000);">
<span :class="{ 'group-hover:block' : !copying }" class="icon-svg hidden group-hover:block"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="M3e2-2e2q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h440q24 0 42 18t18 42v560q0 24-18 42t-42 18H3e2zM180-80q-24 0-42-18t-18-42v-590q0-13 8.5-21.5T150-760t21.5 8.5T180-730v590h470q13 0 21.5 8.5T680-110t-8.5 21.5T650-80H180z"></path></svg></span>
<span :class="{ 'group-hover:block' : copying }" class="icon-svg hidden"><svg width="48" height="48" viewBox="0 -960 960 960"><path d="m421-389-98-98q-9-9-22-9t-23 10q-9 9-9 22t9 22l122 123q9 9 21 9t21-9l239-239q10-10 10-23t-10-23q-10-9-23.5-8.5T635-603L421-389zm59 309q-82 0-155-31.5t-127.5-86-86-127.5T80-480q0-83 31.5-156t86-127T325-848.5 480-880q83 0 156 31.5T763-763t85.5 127T880-480q0 82-31.5 155T763-197.5t-127 86T480-80z"></path></svg></span></button><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> sudo rm /etc/apt/sources.list.d/docker.list
</span></span><span class="line"><span class="cl"><span class="gp">$</span> sudo rm /etc/apt/keyrings/docker.asc
</span></span></code></pre></div></div></div></div></li></ol><p>You have to delete any edited configuration files manually.</p><h2 class="scroll-mt-20" id="next-steps"><a class="text-black dark:text-white no-underline hover:underline" href="#next-steps">Next steps</a></h2><ul><li>Continue to <a class="link" href="https://docs.docker.com/engine/install/linux-postinstall/">Post-installation steps for Linux</a>.</li></ul>


<summary>
<h2 id="una-pagina-con-trucos-de-docker"><a href="#una-pagina-con-trucos-de-docker" onclick="navigator.clipboard.writeText(this.href);">Una página con trucos de Docker</a><a class="hash-anchor" href="#una-pagina-con-trucos-de-docker" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h2>
https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes-es
</summary>
<h3 id="introduccion"><a href="#introduccion" onclick="navigator.clipboard.writeText(this.href);">Introducción</a><a class="hash-anchor" href="#introduccion" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Docker hace que sea fácil envolver sus aplicaciones y servicios en contenedores para poder ejecutarlos en cualquier lugar. Sin embargo, a medida que se trabaja con Docker, también es fácil acumular una cantidad excesiva de imágenes, contenedores y volúmenes de datos que consumen recursos y ocupan espacio en disco.</p>
<p>Docker le brinda todas las herramientas necesarias para limpiar su sistema desde la línea de comandos. En esta guía a modo de página de trucos se brinda una referencia rápida a comandos útiles para liberar espacio en el disco y mantener su sistema organizado mediante la eliminación de imágenes, contenedores y volúmenes no utilizados de Docker.</p>
<p><strong>Cómo utilizar esta guía:</strong></p>
<ul>
<li>Esta guía se ofrece con formato de página de trucos con fragmentos de líneas de comandos independientes.</li>
<li>Vaya a cualquiera de las secciones que corresponda a la tarea que está tratando de completar.</li>
</ul>
<p>La sintaxis de sustitución de comandos, <code><mark>command</mark> $(<mark>command</mark>)</code>, que se utiliza en los comandos, está disponible en muchos shells populares como bash, zsh y Windows Powershell.</p>
</details>
<details class="collapsible" open="">
<summary>
<h2 id="eliminar-las-imagenes-los-contenedores-los-volumenes-y-las-redes-sin-utilizar-o-pendientes"><a href="#eliminar-las-imagenes-los-contenedores-los-volumenes-y-las-redes-sin-utilizar-o-pendientes" onclick="navigator.clipboard.writeText(this.href);">Eliminar las imágenes, los contenedores, los volúmenes y las redes sin utilizar o pendientes.</a><a class="hash-anchor" href="#eliminar-las-imagenes-los-contenedores-los-volumenes-y-las-redes-sin-utilizar-o-pendientes" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h2>
</summary>
<p>Docker proporciona un solo comando que eliminará cualquier recurso (imágenes, contenedores, volúmenes y redes) que estén pendientes (no asociados con un contenedor):</p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> system prune
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p>Para eliminar adicionalmente los contenedores detenidos y todas las imágenes no utilizadas (no solo aquellas pendientes), añada el indicador <code>-a</code> al comando:</p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> system prune <span class="token parameter variable">-a</span>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
</details>
<details class="collapsible" open="">
<summary>
<h2 id="eliminar-imagenes-de-docker"><a href="#eliminar-imagenes-de-docker" onclick="navigator.clipboard.writeText(this.href);">Eliminar imágenes de Docker</a><a class="hash-anchor" href="#eliminar-imagenes-de-docker" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h2>
</summary>
<h3 id="eliminar-una-o-mas-imagenes-especificas"><a href="#eliminar-una-o-mas-imagenes-especificas" onclick="navigator.clipboard.writeText(this.href);">Eliminar una o más imágenes específicas</a><a class="hash-anchor" href="#eliminar-una-o-mas-imagenes-especificas" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Utilice el comando <code>docker images</code> con el indicador <code>-a</code> para localizar el ID de las imágenes que quiere eliminar. Esto le mostrará todas las imágenes, incluidas las capas de imagen intermedias. Cuando localice las imágenes que desee eliminar, puede pasar su ID o etiqueta a <code>docker rmi</code>:</p>
<p><strong>Enumerar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> images <span class="token parameter variable">-a</span>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> rmi <mark>Image</mark> <mark>Image</mark>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<h3 id="eliminar-imagenes-pendientes"><a href="#eliminar-imagenes-pendientes" onclick="navigator.clipboard.writeText(this.href);">Eliminar imágenes pendientes</a><a class="hash-anchor" href="#eliminar-imagenes-pendientes" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Las imágenes de Docker constan de varias capas. Las imágenes pendientes son capas que no tienen relación con imágenes etiquetadas. Ya no sirven para nada y ocupan espacio en el disco. Se pueden ubicar añadiendo el indicador de filtro <code>-f</code> junto con el valor <code>dangling=true</code> al comando <code>docker images</code>. Si está seguro de que quiere eliminarlas, puede utilizar el comando <code>docker images purge</code>:</p>
<div class="callout note">
<p><strong>Nota:</strong> Si crea una imagen sin etiquetar, aparecerá en la lista de imágenes pendientes porque no está asociada a una imagen con etiqueta. Puede evitar esta situación <a href="https://docs.docker.com/engine/reference/commandline/build/#/tag-image--t" rel="ugc nofollow noopener" target="_blank">proporcionando una etiqueta</a> cuando cree imágenes y puede etiquetar de forma retroactiva una imagen con el comando <a href="https://docs.docker.com/engine/reference/commandline/tag/" rel="ugc nofollow noopener" target="_blank">docker tag</a>.</p>
</div>
<p><strong>Enumerar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> images <span class="token parameter variable">-f</span> <span class="token assign-left variable">dangling</span><span class="token operator">=</span>true
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> images purge
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<h3 id="eliminar-imagenes-segun-un-patron"><a href="#eliminar-imagenes-segun-un-patron" onclick="navigator.clipboard.writeText(this.href);">Eliminar imágenes según un patrón</a><a class="hash-anchor" href="#eliminar-imagenes-segun-un-patron" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Puede encontrar todas las imágenes que coinciden con un patrón utilizando una combinación de <code>docker images</code> y <a href="/community/tutorials/using-grep-regular-expressions-to-search-for-text-patterns-in-linux"><code>grep</code></a>. Cuando esté conforme, puede eliminarlas utilizando <code>awk</code> para pasar los ID a <code>docker rmi.</code> Tenga en cuenta que Docker no proporciona estas utilidades y que estas no están necesariamente disponibles en todos los sistemas:</p>
<p><strong>Enumerar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> images <span class="token parameter variable">-a</span> <span class="token operator">|</span>  <span class="token function">grep</span> <span class="token string">"<mark>pattern</mark>"</span>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> images <span class="token parameter variable">-a</span> <span class="token operator">|</span> <span class="token function">grep</span> <span class="token string">"<mark>pattern</mark>"</span> <span class="token operator">|</span> <span class="token function">awk</span> <span class="token string">'{print $3}'</span> <span class="token operator">|</span> <span class="token function">xargs</span> <span class="token function">docker</span> rmi
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<h3 id="eliminar-todas-las-imagenes"><a href="#eliminar-todas-las-imagenes" onclick="navigator.clipboard.writeText(this.href);">Eliminar todas las imágenes</a><a class="hash-anchor" href="#eliminar-todas-las-imagenes" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Es posible enumerar todas las imágenes de Docker de un sistema añadiendo <code>-a</code> al comando <code>docker images</code>. Una vez que esté seguro de que desea eliminarlas por completo, puede añadir el indicador <code>-q</code> para pasar el ID de la imagen a <code>docker rmi</code>:</p>
<p><strong>Enumerar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> images <span class="token parameter variable">-a</span>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> rmi <span class="token variable"><span class="token variable">$(</span><span class="token function">docker</span> images <span class="token parameter variable">-a</span> <span class="token parameter variable">-q</span><span class="token variable">)</span></span>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
</details>
<details class="collapsible" open="">
<summary>
<h2 id="eliminar-contenedores"><a href="#eliminar-contenedores" onclick="navigator.clipboard.writeText(this.href);">Eliminar contenedores</a><a class="hash-anchor" href="#eliminar-contenedores" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h2>
</summary>
<h3 id="eliminar-uno-o-mas-contenedores-especificos"><a href="#eliminar-uno-o-mas-contenedores-especificos" onclick="navigator.clipboard.writeText(this.href);">Eliminar uno o más contenedores específicos</a><a class="hash-anchor" href="#eliminar-uno-o-mas-contenedores-especificos" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Utilice el comando <code>docker ps</code> con el indicador <code>-a</code> para localizar el nombre o la ID de los contenedores que desee eliminar.</p>
<p><strong>Enumerar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> <span class="token function">ps</span> <span class="token parameter variable">-a</span>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> <span class="token function">rm</span> <mark>ID_or_Name</mark> <mark>ID_or_Name</mark>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<h3 id="eliminar-un-contenedor-al-cerrarlo"><a href="#eliminar-un-contenedor-al-cerrarlo" onclick="navigator.clipboard.writeText(this.href);">Eliminar un contenedor al cerrarlo</a><a class="hash-anchor" href="#eliminar-un-contenedor-al-cerrarlo" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Si al crear un contenedor sabe que no querrá conservarlo una vez que lo termine, puede ejecutar <code>docker run --rm</code> para eliminarlo automáticamente después de cerrarlo.</p>
<p><strong>Ejecutar y eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> run <span class="token parameter variable">--rm</span> <mark>image_name</mark>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<h3 id="eliminar-todos-los-contenedores-terminados"><a href="#eliminar-todos-los-contenedores-terminados" onclick="navigator.clipboard.writeText(this.href);">Eliminar todos los contenedores terminados</a><a class="hash-anchor" href="#eliminar-todos-los-contenedores-terminados" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Puede localizar contenedores utilizando <code>docker ps -a</code> y filtrarlos según su estado: “created”, “restarting”, “running”, “paused” o “exited”. A fin de revisar la lista de contenedores terminados, utilice el indicador <code>-f</code> para filtrar según el estado. Cuando haya verificado que desea eliminar esos contenedores, utilice <code>-q</code> para pasar los IDs al comando <code>docker rm</code>.</p>
<p><strong>Enumerar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> <span class="token function">ps</span> <span class="token parameter variable">-a</span> <span class="token parameter variable">-f</span> <span class="token assign-left variable">status</span><span class="token operator">=</span>exited
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> <span class="token function">rm</span> <span class="token variable"><span class="token variable">$(</span><span class="token function">docker</span> <span class="token function">ps</span> <span class="token parameter variable">-a</span> <span class="token parameter variable">-f</span> <span class="token assign-left variable">status</span><span class="token operator">=</span>exited <span class="token parameter variable">-q</span><span class="token variable">)</span></span>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<h3 id="eliminar-contenedores-utilizando-mas-de-un-filtro"><a href="#eliminar-contenedores-utilizando-mas-de-un-filtro" onclick="navigator.clipboard.writeText(this.href);">Eliminar contenedores utilizando más de un filtro</a><a class="hash-anchor" href="#eliminar-contenedores-utilizando-mas-de-un-filtro" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Los filtros de Docker pueden combinarse repitiendo el indicador de filtro con un valor adicional. Esto da como resultado una lista de contenedores que cumplen cualquier condición. Por ejemplo, si desea eliminar todos los contenedores marcados como <strong>Created</strong> (un estado que se puede generar cuando ejecuta un contenedor con un comando no válido) o <strong>Exited</strong>, puede utilizar dos filtros:</p>
<p><strong>Enumerar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> <span class="token function">ps</span> <span class="token parameter variable">-a</span> <span class="token parameter variable">-f</span> <span class="token assign-left variable">status</span><span class="token operator">=</span>exited <span class="token parameter variable">-f</span> <span class="token assign-left variable">status</span><span class="token operator">=</span>created
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> <span class="token function">rm</span> <span class="token variable"><span class="token variable">$(</span><span class="token function">docker</span> <span class="token function">ps</span> <span class="token parameter variable">-a</span> <span class="token parameter variable">-f</span> <span class="token assign-left variable">status</span><span class="token operator">=</span>exited <span class="token parameter variable">-f</span> <span class="token assign-left variable">status</span><span class="token operator">=</span>created <span class="token parameter variable">-q</span><span class="token variable">)</span></span>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<h3 id="eliminar-contenedores-segun-un-patron"><a href="#eliminar-contenedores-segun-un-patron" onclick="navigator.clipboard.writeText(this.href);">Eliminar contenedores según un patrón</a><a class="hash-anchor" href="#eliminar-contenedores-segun-un-patron" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Puede encontrar todos los contenedores que coinciden con un patrón utilizando la combinación de <code>docker ps</code> y <a href="/community/tutorials/using-grep-regular-expressions-to-search-for-text-patterns-in-linux">grep</a>. Cuando esté convencido de que tiene la lista que desea eliminar, podrá utilizar <code>awk</code> y <code>xargs</code> para proporcionar el ID a <code>docker rmi</code>. Tenga en cuenta que Docker no proporciona estas utilidades y que no están necesariamente disponibles en todos los sistemas:</p>
<p><strong>Enumerar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> <span class="token function">ps</span> <span class="token parameter variable">-a</span> <span class="token operator">|</span>  <span class="token function">grep</span> "<mark>pattern</mark>”
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> <span class="token function">ps</span> <span class="token parameter variable">-a</span> <span class="token operator">|</span> <span class="token function">grep</span> <span class="token string">"<mark>pattern</mark>"</span> <span class="token operator">|</span> <span class="token function">awk</span> <span class="token string">'{print $3}'</span> <span class="token operator">|</span> <span class="token function">xargs</span> <span class="token function">docker</span> rmi
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<h3 id="detener-y-eliminar-todos-los-contenedores"><a href="#detener-y-eliminar-todos-los-contenedores" onclick="navigator.clipboard.writeText(this.href);">Detener y eliminar todos los contenedores</a><a class="hash-anchor" href="#detener-y-eliminar-todos-los-contenedores" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Puede revisar los contenedores de su sistema con <code>docker ps</code>. Al añadir el indicador <code>-a</code> se mostrarán todos los contenedores. Cuando esté seguro de que desea eliminarlos, puede añadir el indicador <code>-q</code> para proporcionar los ID a los comandos <code>docker stop</code> y <code>docker rm</code>:</p>
<p><strong>Enumerar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> <span class="token function">ps</span> <span class="token parameter variable">-a</span>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> stop <span class="token variable"><span class="token variable">$(</span><span class="token function">docker</span> <span class="token function">ps</span> <span class="token parameter variable">-a</span> <span class="token parameter variable">-q</span><span class="token variable">)</span></span>
</li><li data-prefix="$"><span class="token function">docker</span> <span class="token function">rm</span> <span class="token variable"><span class="token variable">$(</span><span class="token function">docker</span> <span class="token function">ps</span> <span class="token parameter variable">-a</span> <span class="token parameter variable">-q</span><span class="token variable">)</span></span>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
</details>
<details class="collapsible" open="">
<summary>
<h2 id="eliminar-volumenes"><a href="#eliminar-volumenes" onclick="navigator.clipboard.writeText(this.href);">Eliminar volúmenes</a><a class="hash-anchor" href="#eliminar-volumenes" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h2>
</summary>
<h3 id="eliminar-uno-o-mas-volumenes-especificos-docker-1-9-y-versiones-posteriores"><a href="#eliminar-uno-o-mas-volumenes-especificos-docker-1-9-y-versiones-posteriores" onclick="navigator.clipboard.writeText(this.href);">Eliminar uno o más volúmenes específicos - Docker 1.9 y versiones posteriores</a><a class="hash-anchor" href="#eliminar-uno-o-mas-volumenes-especificos-docker-1-9-y-versiones-posteriores" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Utilice el comando <code>docker volume ls</code> para ubicar el nombre o los nombres de los volúmenes que desea eliminar. Luego, puede eliminar uno o más volúmenes con el comando <code>docker volume rm</code>:</p>
<p><strong>Enumerar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> volume <span class="token function">ls</span>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> volume <span class="token function">rm</span> <mark>volume_name</mark> <mark>volume_name</mark>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<h3 id="eliminar-volumenes-pendientes-docker-1-9-y-versiones-posteriores"><a href="#eliminar-volumenes-pendientes-docker-1-9-y-versiones-posteriores" onclick="navigator.clipboard.writeText(this.href);">Eliminar volúmenes pendientes: Docker 1.9 y versiones posteriores</a><a class="hash-anchor" href="#eliminar-volumenes-pendientes-docker-1-9-y-versiones-posteriores" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Debido a que el punto de volúmenes debe existir independientemente de los contenedores, cuando se elimina un contenedor un volumen no se elimina automáticamente al mismo tiempo. Cuando un volumen existe y ya no está conectado a ningún contenedor, se denomina “volumen pendiente”. Para ubicarlos y confirmar que desea eliminarlos, puede utilizar el comando <code>docker volume ls</code> con un filtro a fin de limitar los resultados a volúmenes pendientes. Cuando esté conforme con la lista, puede eliminarlos con <code>docker volume prune</code>:</p>
<p><strong>Enumerar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> volume <span class="token function">ls</span> <span class="token parameter variable">-f</span> <span class="token assign-left variable">dangling</span><span class="token operator">=</span>true
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> volume prune
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
<h3 id="eliminar-un-contenedor-y-su-volumen"><a href="#eliminar-un-contenedor-y-su-volumen" onclick="navigator.clipboard.writeText(this.href);">Eliminar un contenedor y su volumen</a><a class="hash-anchor" href="#eliminar-un-contenedor-y-su-volumen" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h3>
<p>Si creó un volumen sin nombre, puede eliminarlo al mismo tiempo que el contenedor utilizando el indicador <code>-v</code>. Tenga en cuenta que esto solo funciona con volúmenes <em>sin nombre</em>. Cuando el contenedor se elimina correctamente, se muestra su ID. Tenga en cuenta que no se hace referencia a la eliminación del volumen. Si no tiene nombre, se elimina silenciosamente del sistema. Si se nombra, permanece silenciosamente presente.</p>
<p><strong>Eliminar:</strong></p>
<div class="code-label" title=""></div>
<div class="code-toolbar"><pre class="prefixed command language-bash"><code><ol><li data-prefix="$"><span class="token function">docker</span> <span class="token function">rm</span> <span class="token parameter variable">-v</span> <mark>container_name</mark>
</li></ol>
</code></pre><div class="toolbar"><div class="toolbar-item"><button>Copy</button></div></div></div>
</details>
<details class="collapsible" open="">
<summary>
<h2 id="conclusion"><a href="#conclusion" onclick="navigator.clipboard.writeText(this.href);">Conclusión</a><a class="hash-anchor" href="#conclusion" aria-hidden="true" onclick="navigator.clipboard.writeText(this.href);"></a></h2>
</summary>
<p>Esta guía abarca algunos de los comandos comunes que se utilizan para eliminar imágenes, contenedores y volúmenes con Docker. Hay una gran cantidad adicional de combinaciones e indicadores que se pueden utilizar con cada uno de estos. Para acceder a una guía completa de lo que está disponible, consulte la documentación de Docker sobre <a href="https://docs.docker.com/engine/reference/commandline/system_prune/" rel="ugc nofollow noopener" target="_blank"><code>docker system prune</code></a>, <a href="https://docs.docker.com/engine/reference/commandline/rmi/" rel="ugc nofollow noopener" target="_blank"><code>docker rmi</code></a>, <a href="https://docs.docker.com/engine/reference/commandline/rm/" rel="ugc nofollow noopener" target="_blank"><code>docker rm</code></a> y <a href="https://docs.docker.com/engine/reference/commandline/volume_rm/" rel="ugc nofollow noopener" target="_blank"><code>docker volume rm</code></a>. Si hay tareas de limpieza comunes que desearía ver en la guía, haga preguntas o sugerencias en los comentarios.</p>
</details>
</div>
<a alt="Creative Commons url" href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons" loading="lazy" width="146" height="51" decoding="async" data-nimg="1" style="color: transparent;" srcset="https://www.digitalocean.com/api/static-content/v1/images?src=%2F_next%2Fstatic%2Fmedia%2Fcreativecommons.c0a877f1.png&amp;width=256 1x, https://www.digitalocean.com/api/static-content/v1/images?src=%2F_next%2Fstatic%2Fmedia%2Fcreativecommons.c0a877f1.png&amp;width=384 2x" src="https://www.digitalocean.com/api/static-content/v1/images?src=%2F_next%2Fstatic%2Fmedia%2Fcreativecommons.c0a877f1.png&amp;width=384"></a><span class="Typographystyles-sc-o7qsl9-0 jfxkfG">This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.</span></div>