{"id":220,"date":"2026-06-02T23:24:21","date_gmt":"2026-06-03T06:24:21","guid":{"rendered":"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/"},"modified":"2026-06-02T23:24:21","modified_gmt":"2026-06-03T06:24:21","slug":"how-to-install-docker-on-ubuntu","status":"publish","type":"post","link":"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/","title":{"rendered":"How to Install Docker on Ubuntu (20.04, 22.04 &amp; 24.04)"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>Docker is a containerisation platform that lets you package and run applications in isolated environments called containers. Instead of installing software directly on your server and wrestling with dependency conflicts, you spin up a container, run your app, and tear it down when you&#8217;re done. It&#8217;s become standard on everything from developer laptops to production <a href=\"https:\/\/www.hostandtech.com\/vps-ssd-servers\">VPS SSD Hosting<\/a> environments.<\/p>\n<p>The Docker installation process on Ubuntu is well-documented but easy to get wrong. The main mistake I see is people installing the <code class=\"\" data-line=\"\">docker.io<\/code> package from Ubuntu&#8217;s default repositories. That version is almost always outdated. This guide uses Docker&#8217;s official APT repository, which is the right way to do it.<\/p>\n<p>This article covers Ubuntu 20.04 (Focal), 22.04 (Jammy), and 24.04 (Noble). The steps are nearly identical across all three, but I&#8217;ll call out any differences where they exist.<\/p>\n<h2>Prerequisites<\/h2>\n<ul>\n<li>A server or VPS running Ubuntu 20.04, 22.04, or 24.04 (64-bit)<\/li>\n<li>Root or <code class=\"\" data-line=\"\">sudo<\/code> access<\/li>\n<li>At least 2 GB of RAM recommended for running containers comfortably<\/li>\n<li>A working internet connection from the server (Docker pulls images from Docker Hub)<\/li>\n<li>Basic familiarity with the Linux command line<\/li>\n<\/ul>\n<h2>Step-by-Step Installation<\/h2>\n<h3>Step 1: Remove Old or Conflicting Docker Packages<\/h3>\n<p>Before installing anything, remove any existing Docker packages that might conflict. Ubuntu&#8217;s default repos ship packages named <code class=\"\" data-line=\"\">docker.io<\/code>, <code class=\"\" data-line=\"\">docker-compose<\/code>, and a few others that will clash with the official Docker packages.<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-1\"><code class=\"\" data-line=\"\">sudo apt remove docker docker-engine docker.io containerd runc docker-compose<\/code><\/pre>\n<\/div>\n<p>If none of those are installed, <code class=\"\" data-line=\"\">apt<\/code> will just say so and move on. That&#8217;s fine.<\/p>\n<h3>Step 2: Update Your Package Index and Install Dependencies<\/h3>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-2\"><code class=\"\" data-line=\"\">sudo apt update\nsudo apt install -y ca-certificates curl gnupg lsb-release<\/code><\/pre>\n<\/div>\n<p>These packages let your system verify the Docker repository&#8217;s GPG key and handle HTTPS transport for APT.<\/p>\n<h3>Step 3: Add Docker&#8217;s Official GPG Key<\/h3>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-3\"><code class=\"\" data-line=\"\">sudo install -m 0755 -d \/etc\/apt\/keyrings\ncurl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo gpg --dearmor -o \/etc\/apt\/keyrings\/docker.gpg\nsudo chmod a+r \/etc\/apt\/keyrings\/docker.gpg<\/code><\/pre>\n<\/div>\n<p>The <code class=\"\" data-line=\"\">chmod a+r<\/code> at the end ensures APT can actually read the key file. Skipping this causes a silent failure that&#8217;s annoying to debug.<\/p>\n<h3>Step 4: Add the Docker APT Repository<\/h3>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-4\"><code class=\"\" data-line=\"\">echo \n  &quot;deb [arch=$(dpkg --print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.gpg] \n  https:\/\/download.docker.com\/linux\/ubuntu \n  $(. \/etc\/os-release &amp;&amp; echo &quot;$VERSION_CODENAME&quot;) stable&quot; | \n  sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null<\/code><\/pre>\n<\/div>\n<p>This uses <code class=\"\" data-line=\"\">VERSION_CODENAME<\/code> from <code class=\"\" data-line=\"\">\/etc\/os-release<\/code> to automatically pick the right repo for your Ubuntu version \u2014 whether that&#8217;s <code class=\"\" data-line=\"\">focal<\/code>, <code class=\"\" data-line=\"\">jammy<\/code>, or <code class=\"\" data-line=\"\">noble<\/code>.<\/p>\n<p>\ud83d\udcdd Note: If you&#8217;re on Ubuntu 24.04 and hit an error here, double-check that <code class=\"\" data-line=\"\">\/etc\/os-release<\/code> contains <code class=\"\" data-line=\"\">VERSION_CODENAME=noble<\/code>. Some minimal cloud images occasionally omit this line.<\/p>\n<h3>Step 5: Install Docker Engine<\/h3>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-5\"><code class=\"\" data-line=\"\">sudo apt update\nsudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/code><\/pre>\n<\/div>\n<p>This installs Docker Engine (<code class=\"\" data-line=\"\">docker-ce<\/code>), the CLI, <code class=\"\" data-line=\"\">containerd<\/code> as the container runtime, and the Buildx and Compose plugins. You want all of these. Running just <code class=\"\" data-line=\"\">docker-ce<\/code> alone will leave you missing <code class=\"\" data-line=\"\">docker compose<\/code> (v2) later.<\/p>\n<h3>Step 6: Verify the Installation<\/h3>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-6\"><code class=\"\" data-line=\"\">sudo docker run hello-world<\/code><\/pre>\n<\/div>\n<p>Docker will pull the <code class=\"\" data-line=\"\">hello-world<\/code> image from Docker Hub and run it. If you see <em>&#8220;Hello from Docker!&#8221;<\/em> in the output, the installation is working correctly.<\/p>\n<h3>Step 7: Enable Docker to Start on Boot<\/h3>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-7\"><code class=\"\" data-line=\"\">sudo systemctl enable docker\nsudo systemctl start docker<\/code><\/pre>\n<\/div>\n<p>On most Ubuntu cloud images, Docker starts automatically after install. Still worth confirming, especially on VPS environments where some providers ship stripped-down systemd configurations.<\/p>\n<h3>Step 8: Add Your User to the Docker Group (Post-Install)<\/h3>\n<p>By default, running Docker commands requires <code class=\"\" data-line=\"\">sudo<\/code>. If you&#8217;re managing your own server and don&#8217;t want to prefix every command, add your user to the <code class=\"\" data-line=\"\">docker<\/code> group.<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-8\"><code class=\"\" data-line=\"\">sudo usermod -aG docker $USER\nnewgrp docker<\/code><\/pre>\n<\/div>\n<p>\u26a0 Warning: Adding a user to the <code class=\"\" data-line=\"\">docker<\/code> group is effectively giving them root-equivalent access on that machine. The Docker daemon runs as root and a user in the <code class=\"\" data-line=\"\">docker<\/code> group can mount the host filesystem into a container. Only do this on servers where you trust all users with sudo-level access.<\/p>\n<p>After running <code class=\"\" data-line=\"\">newgrp docker<\/code>, test without sudo:<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-9\"><code class=\"\" data-line=\"\">docker ps<\/code><\/pre>\n<\/div>\n<p>If you still get a permission error, log out and back in. The group change doesn&#8217;t always apply immediately in all terminal sessions.<\/p>\n<h2>Verify Docker Compose v2<\/h2>\n<p>The old <code class=\"\" data-line=\"\">docker-compose<\/code> (v1, standalone Python binary) is deprecated. The current version ships as a Docker CLI plugin and is called with <code class=\"\" data-line=\"\">docker compose<\/code> (no hyphen).<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-10\"><code class=\"\" data-line=\"\">docker compose version<\/code><\/pre>\n<\/div>\n<p>You should see something like <code class=\"\" data-line=\"\">Docker Compose version v2.27.x<\/code> or newer. If the command isn&#8217;t found, go back and make sure you installed <code class=\"\" data-line=\"\">docker-compose-plugin<\/code> in Step 5.<\/p>\n<h2>Common Issues &amp; Troubleshooting<\/h2>\n<h3>Permission denied while connecting to the Docker daemon socket<\/h3>\n<p><strong>Cause:<\/strong> You&#8217;re running <code class=\"\" data-line=\"\">docker<\/code> commands as a non-root user who isn&#8217;t in the <code class=\"\" data-line=\"\">docker<\/code> group, or the group change hasn&#8217;t taken effect in the current session.<\/p>\n<p><strong>Fix:<\/strong> Either prefix your command with <code class=\"\" data-line=\"\">sudo<\/code>, or run <code class=\"\" data-line=\"\">newgrp docker<\/code> after adding yourself to the group. If that doesn&#8217;t work, fully log out and back in. SSH sessions don&#8217;t always pick up group changes until the session is refreshed.<\/p>\n<h3>Cannot connect to the Docker daemon \u2014 is it running?<\/h3>\n<p><strong>Cause:<\/strong> The Docker service isn&#8217;t started, or it failed to start due to a port or socket conflict.<\/p>\n<p><strong>Fix:<\/strong> Check the service status and logs:<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-11\"><code class=\"\" data-line=\"\">sudo systemctl status docker\nsudo journalctl -u docker --no-pager -n 50<\/code><\/pre>\n<\/div>\n<p>A common culprit on VPS hosts is an existing <code class=\"\" data-line=\"\">containerd<\/code> installation conflicting with the one Docker tries to manage. Removing the system <code class=\"\" data-line=\"\">containerd<\/code> package and letting Docker manage its own usually resolves it.<\/p>\n<h3>Package docker-ce has no installation candidate<\/h3>\n<p><strong>Cause:<\/strong> The Docker APT repository wasn&#8217;t added correctly, or <code class=\"\" data-line=\"\">apt update<\/code> wasn&#8217;t run after adding it.<\/p>\n<p><strong>Fix:<\/strong> Verify the repo file exists and looks correct, then refresh:<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-12\"><code class=\"\" data-line=\"\">cat \/etc\/apt\/sources.list.d\/docker.list\nsudo apt update<\/code><\/pre>\n<\/div>\n<p>If the file is empty or missing, repeat Steps 3 and 4. A wrong codename in the repo URL (e.g. accidentally using <code class=\"\" data-line=\"\">focal<\/code> on a 22.04 system) will also cause this error.<\/p>\n<h3>docker: Error response from daemon: pull access denied<\/h3>\n<p><strong>Cause:<\/strong> The image name is wrong, the image is private and you&#8217;re not authenticated, or Docker Hub rate limiting has kicked in on an unauthenticated IP.<\/p>\n<p><strong>Fix:<\/strong> Double-check the image name and tag. For private images, run <code class=\"\" data-line=\"\">docker login<\/code> first. For rate limiting, logging in with a free Docker Hub account significantly raises your pull limits. This error is annoyingly common on shared NAT VPS environments where many servers share an outbound IP.<\/p>\n<h3>Failed to set up loop device \/ overlayfs errors on older kernels<\/h3>\n<p><strong>Cause:<\/strong> Docker&#8217;s default storage driver is <code class=\"\" data-line=\"\">overlay2<\/code>, which requires a kernel version of at least 4.0 with <code class=\"\" data-line=\"\">overlay<\/code> support compiled in. Some older Ubuntu 20.04 LTS installs on certain VPS providers ship with kernels that lack this.<\/p>\n<p><strong>Fix:<\/strong> Check your kernel version with <code class=\"\" data-line=\"\">uname -r<\/code>. If you&#8217;re on a kernel older than 5.4, I&#8217;d recommend upgrading via <code class=\"\" data-line=\"\">sudo apt install linux-generic<\/code> and rebooting. Running Ubuntu 22.04 or 24.04 avoids this entirely.<\/p>\n<h2>FAQ<\/h2>\n<div class=\"ht-faq-section\">\n<h2>Frequently Asked Questions<\/h2>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">Can I install Docker on a shared hosting plan?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>No. Docker requires root access and kernel-level features that shared hosting environments don&#8217;t provide. You&#8217;ll need a VPS or dedicated server to run Docker. Host &amp; Tech&#8217;s VPS plans start at $5.83\/mo and give you full root access out of the box.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">What&#039;s the difference between docker-ce and docker.io?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>docker-ce is Docker&#8217;s official Community Edition, distributed directly by Docker Inc through their own APT repository. docker.io is Ubuntu&#8217;s repackaged version, which tends to lag several major versions behind. For anything beyond testing, always install docker-ce from Docker&#8217;s official repo.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">How do I update Docker after installation?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>Since you installed Docker through APT, updating is just a standard package upgrade: run <code class=\"\" data-line=\"\">sudo apt update &amp;&amp; sudo apt upgrade docker-ce docker-ce-cli containerd.io<\/code>. You don&#8217;t need to uninstall and reinstall. Check the current version with <code class=\"\" data-line=\"\">docker version<\/code>.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">Does Docker work on Ubuntu running inside a VPS or VM?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>Yes, in most cases. Most modern hypervisors (KVM, Xen, VMware) support the kernel features Docker needs. OpenVZ-based VPS containers are the main exception \u2014 they use container-level virtualisation that can block Docker from running properly. If you&#8217;re on a Host &amp; Tech KVM VPS, Docker works without any special configuration.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">How do I completely uninstall Docker from Ubuntu?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>Run <code class=\"\" data-line=\"\">sudo apt purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/code> to remove all packages. Docker doesn&#8217;t automatically delete images, containers, or volumes when you uninstall \u2014 those live in <code class=\"\" data-line=\"\">\/var\/lib\/docker<\/code>. Remove that directory manually with <code class=\"\" data-line=\"\">sudo rm -rf \/var\/lib\/docker<\/code> if you want a clean slate.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Docker lets you run applications in isolated containers without touching the rest of your server. This guide walks you through a clean Docker installation on Ubuntu 20.04, 22.04, and 24.04, including the post-install steps most tutorials skip.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[49],"tags":[610,609,613,611,12,612,15,11],"class_list":["post-220","post","type-post","status-publish","format-standard","hentry","category-linux","tag-containers","tag-docker","tag-docker-installation-ubuntu","tag-docker-compose","tag-linux","tag-server-setup","tag-ubuntu","tag-vps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install Docker on Ubuntu (20.04, 22.04 &amp; 24.04)<\/title>\n<meta name=\"description\" content=\"Step-by-step Docker installation guide for Ubuntu 20.04, 22.04, and 24.04. Covers setup, post-install config, and common errors with fixes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Docker on Ubuntu (20.04, 22.04 &amp; 24.04)\" \/>\n<meta property=\"og:description\" content=\"Step-by-step Docker installation guide for Ubuntu 20.04, 22.04, and 24.04. Covers setup, post-install config, and common errors with fixes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Host And Tech knowledge base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/stshostandtech\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-03T06:24:21+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@stshostandtech\" \/>\n<meta name=\"twitter:site\" content=\"@stshostandtech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/how-to-install-docker-on-ubuntu\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/how-to-install-docker-on-ubuntu\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/person\\\/b6fa79c48ddaba71af32e395c5b017ee\"},\"headline\":\"How to Install Docker on Ubuntu (20.04, 22.04 &amp; 24.04)\",\"datePublished\":\"2026-06-03T06:24:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/how-to-install-docker-on-ubuntu\\\/\"},\"wordCount\":1240,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\"},\"keywords\":[\"containers\",\"docker\",\"Docker installation Ubuntu\",\"docker-compose\",\"Linux\",\"server-setup\",\"Ubuntu\",\"VPS\"],\"articleSection\":[\"Linux Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/how-to-install-docker-on-ubuntu\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/how-to-install-docker-on-ubuntu\\\/\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/how-to-install-docker-on-ubuntu\\\/\",\"name\":\"How to Install Docker on Ubuntu (20.04, 22.04 & 24.04)\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#website\"},\"datePublished\":\"2026-06-03T06:24:21+00:00\",\"description\":\"Step-by-step Docker installation guide for Ubuntu 20.04, 22.04, and 24.04. Covers setup, post-install config, and common errors with fixes.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/how-to-install-docker-on-ubuntu\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/how-to-install-docker-on-ubuntu\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/how-to-install-docker-on-ubuntu\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Docker on Ubuntu (20.04, 22.04 &amp; 24.04)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\",\"name\":\"Host And Tech knowledge base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\",\"name\":\"Host And Tech knowledge base\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/logo-dark.png\",\"contentUrl\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/logo-dark.png\",\"width\":1134,\"height\":395,\"caption\":\"Host And Tech knowledge base\"},\"image\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/stshostandtech\",\"https:\\\/\\\/x.com\\\/stshostandtech\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/person\\\/b6fa79c48ddaba71af32e395c5b017ee\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/hostandtech.com\\\/kb\"],\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/author\\\/admin_fjj7qydm\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Docker on Ubuntu (20.04, 22.04 & 24.04)","description":"Step-by-step Docker installation guide for Ubuntu 20.04, 22.04, and 24.04. Covers setup, post-install config, and common errors with fixes.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Docker on Ubuntu (20.04, 22.04 & 24.04)","og_description":"Step-by-step Docker installation guide for Ubuntu 20.04, 22.04, and 24.04. Covers setup, post-install config, and common errors with fixes.","og_url":"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/","og_site_name":"Host And Tech knowledge base","article_publisher":"https:\/\/www.facebook.com\/stshostandtech","article_published_time":"2026-06-03T06:24:21+00:00","author":"admin","twitter_card":"summary_large_image","twitter_creator":"@stshostandtech","twitter_site":"@stshostandtech","twitter_misc":{"Written by":"admin","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/"},"author":{"name":"admin","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/person\/b6fa79c48ddaba71af32e395c5b017ee"},"headline":"How to Install Docker on Ubuntu (20.04, 22.04 &amp; 24.04)","datePublished":"2026-06-03T06:24:21+00:00","mainEntityOfPage":{"@id":"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/"},"wordCount":1240,"commentCount":0,"publisher":{"@id":"https:\/\/hostandtech.com\/kb\/#organization"},"keywords":["containers","docker","Docker installation Ubuntu","docker-compose","Linux","server-setup","Ubuntu","VPS"],"articleSection":["Linux Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/","url":"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/","name":"How to Install Docker on Ubuntu (20.04, 22.04 & 24.04)","isPartOf":{"@id":"https:\/\/hostandtech.com\/kb\/#website"},"datePublished":"2026-06-03T06:24:21+00:00","description":"Step-by-step Docker installation guide for Ubuntu 20.04, 22.04, and 24.04. Covers setup, post-install config, and common errors with fixes.","breadcrumb":{"@id":"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hostandtech.com\/kb\/linux\/how-to-install-docker-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hostandtech.com\/kb\/"},{"@type":"ListItem","position":2,"name":"How to Install Docker on Ubuntu (20.04, 22.04 &amp; 24.04)"}]},{"@type":"WebSite","@id":"https:\/\/hostandtech.com\/kb\/#website","url":"https:\/\/hostandtech.com\/kb\/","name":"Host And Tech knowledge base","description":"","publisher":{"@id":"https:\/\/hostandtech.com\/kb\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hostandtech.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hostandtech.com\/kb\/#organization","name":"Host And Tech knowledge base","url":"https:\/\/hostandtech.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/05\/logo-dark.png","contentUrl":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/05\/logo-dark.png","width":1134,"height":395,"caption":"Host And Tech knowledge base"},"image":{"@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/stshostandtech","https:\/\/x.com\/stshostandtech"]},{"@type":"Person","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/person\/b6fa79c48ddaba71af32e395c5b017ee","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/hostandtech.com\/kb"],"url":"https:\/\/hostandtech.com\/kb\/author\/admin_fjj7qydm\/"}]}},"_links":{"self":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts\/220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/comments?post=220"}],"version-history":[{"count":0,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts\/220\/revisions"}],"wp:attachment":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/media?parent=220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/categories?post=220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/tags?post=220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}