{"id":17768,"date":"2026-08-28T12:42:34","date_gmt":"2026-08-28T11:42:34","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=17768"},"modified":"2026-08-28T12:42:35","modified_gmt":"2026-08-28T11:42:35","slug":"how-to-install-docker-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/","title":{"rendered":"How to Install Docker on Ubuntu?"},"content":{"rendered":"\n<p>Docker is one of the most popular tools when it comes to containerizing an application. Docker lets you build an application in a container that can be deployed in any environment. Because Docker maintains the consistency and similarity among various environments, developing, testing and deploying an application becomes easier.<\/p>\n\n\n\n<p>In this guide, we will show you how to easily set up Docker on an Ubuntu server using the official Docker repository. You will have to perform the installation through the command line with a sudo user.<\/p>\n\n\n\n<p><strong>Prerequisites<\/strong><\/p>\n\n\n\n<p>To install Docker on an Ubuntu server, you will need to satisfy the following requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ubuntu 64 bit<\/li>\n\n\n\n<li>A user with sudo rights<\/li>\n\n\n\n<li>Internet connection<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Update Ubuntu Packages<\/h3>\n\n\n\n<p>Update your package list, install packages, and add Docker\u2019s repository.<\/p>\n\n\n\n<p>Execute the following commands one after the other in the terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\n\nsudo apt install ca-certificates curl -y<\/code><\/pre>\n\n\n\n<p>The parameters &#8211; &#8216;ca-certificates&#8217; and &#8216;curl&#8217; respectively represent the package that allow your system to verify secured HTTPS connections, and the package used to download Docker\u2019s GPG key.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Import Docker&#8217;s GPG key<\/h3>\n\n\n\n<p>Using Docker\u2019s GPG key ensures that packages downloaded from Docker repositories are not tampered with.<\/p>\n\n\n\n<p>Create a keyring directory and get the Docker signing key.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir -p \/etc\/apt\/keyrings\n\nsudo curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg \\\n\n-o \/etc\/apt\/keyrings\/docker.asc\n\nsudo chmod a+r \/etc\/apt\/keyrings\/docker.asc<\/code><\/pre>\n\n\n\n<p>Add Docker\u2019s key to the system keyring which Ubuntu will use to validate Docker packages.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add the Docker Repository<\/h3>\n\n\n\n<p>Then add the Docker&#8217;s official APT repository to the Ubuntu system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \\\n\n&nbsp;&nbsp;\"Types: deb\n\n&nbsp;&nbsp;URIs: https:\/\/download.docker.com\/linux\/ubuntu\n\n&nbsp;&nbsp;Suites: $(. \/etc\/os-release &amp;&amp; echo \"${UBUNTU_CODENAME:-$VERSION_CODENAME}\")\n\n&nbsp;&nbsp;Components: stable\n\n&nbsp;&nbsp;Architectures: $(dpkg --print-architecture)\n\n&nbsp;&nbsp;Signed-By: \/etc\/apt\/keyrings\/docker.asc\" | \\\n\n&nbsp;&nbsp;sudo tee \/etc\/apt\/sources.list.d\/docker.sources &gt; \/dev\/null<\/code><\/pre>\n\n\n\n<p>Update Ubuntu\u2019s package list again after adding the repository:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<p>Using Docker\u2019s official repository ensures you install the latest stable Docker packages providing for the Ubuntu release.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install Docker<\/h3>\n\n\n\n<p>Now install Docker Engine along with the Docker CLI, container runtime, Buildx, and Docker Compose plugin.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install docker-ce docker-ce-cli containerd.io \\<br>docker-buildx-plugin docker-compose-plugin -y<br><br><br>The installation takes a couple of moments. Once completed, Docker\u2019s service should be available on the server.&nbsp;<\/code><\/pre>\n\n\n\n<p>You can launch Docker manually in case of its unresponsiveness:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start docker<\/code><\/pre>\n\n\n\n<p>Ensure Docker starts automatically whenever the server boots, run:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable docker<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Check the Docker Installation<\/h3>\n\n\n\n<p>Verify the Docker installation stats by checking its version through command:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker \u2013version<\/code><\/pre>\n\n\n\n<p>For an additional test, run Docker\u2019s official hello-world image:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker run hello-world<\/code><\/pre>\n\n\n\n<p>If Docker functions properly, the command will download the image and display a confirmation message. It confirms that Docker downloads images and creates containers successfully.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Run Docker Without sudo<\/h3>\n\n\n\n<p>By default, Docker commands need sudo. If you want to run Docker as a regular user, add the user to the Docker group:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo usermod -aG docker $USER<\/code><\/pre>\n\n\n\n<p>Log out to the server for the group change to take effect. Then test Docker again:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker run hello-world<\/code><\/pre>\n\n\n\n<p>You can run Docker commands without adding sudo.<\/p>\n\n\n\n<p><strong>Note:<\/strong> Membership in the Docker group provides root-level privileges on the host. Only add trusted users to this group.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Useful Docker Commands<\/h3>\n\n\n\n<p>There are some helpful Docker commands to use after the installation.<\/p>\n\n\n\n<p><strong>To Check Running Containers<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker ps<\/code><\/pre>\n\n\n\n<p>To track running and stopped containers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker ps -a<\/code><\/pre>\n\n\n\n<p><strong>Download a Docker Image<\/strong><\/p>\n\n\n\n<p>For instance, if you want to download the Nginx image:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker pull nginx<\/code><\/pre>\n\n\n\n<p><strong>Design and launch a Container<\/strong><\/p>\n\n\n\n<p>When users run them, the images will be launched:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker run -d --name webserver -p 8080:80 nginx<\/code><\/pre>\n\n\n\n<p>It will run Nginx in the background and map your server&#8217;s port 8080 to port 8 in the container.<\/p>\n\n\n\n<p><strong>Stop a Container<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker stop webserver<\/code><\/pre>\n\n\n\n<p><strong>Create a Stopped Container<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker start webserver<\/code><\/pre>\n\n\n\n<p><strong>View Downloaded Images<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker images<\/code><\/pre>\n\n\n\n<div class=\"vlt-box \">\r\n<div class=\"box-title\" style=\"background:#D5EAFF; color:#000\">Conclusion<\/div>\r\n<div class=\"box-content\" >\r\n<p>Docker simplifies deploying apps in isolated and consistent environments. Docker Engine and Docker tools like Docker Compose and Buildx are installed as part of Docker through its official Ubuntu repository. <\/p>\r\n<p>After installing Docker, you can download images, build containers and deploy applications on your Ubuntu server.<\/p>\r\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Docker is one of the most popular tools when it comes to containerizing an application. Docker lets you build an application in a container that can be deployed in any environment. Because Docker maintains the consistency and similarity among various environments, developing, testing and deploying an application becomes easier. In this guide, we will show [&hellip;]<\/p>\n","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-17768","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-vps-faq"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install Docker on Ubuntu?<\/title>\n<meta name=\"description\" content=\"Learn how to install Docker on Ubuntu with this step-by-step terminal guide. Set up the official repository, install Docker Engine, and run your first container.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Docker on Ubuntu?\" \/>\n<meta property=\"og:description\" content=\"Learn how to install Docker on Ubuntu with this step-by-step terminal guide. Set up the official repository, install Docker Engine, and run your first container.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-28T11:42:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-28T11:42:35+00:00\" \/>\n<meta name=\"author\" content=\"Jackson Lane\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jackson Lane\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/\",\"name\":\"How to Install Docker on Ubuntu?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"datePublished\":\"2026-08-28T11:42:34+00:00\",\"dateModified\":\"2026-08-28T11:42:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/1f580bdff0fa81720fae0fd0c3919758\"},\"description\":\"Learn how to install Docker on Ubuntu with this step-by-step terminal guide. Set up the official repository, install Docker Engine, and run your first container.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Docker on Ubuntu?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/1f580bdff0fa81720fae0fd0c3919758\",\"name\":\"Jackson Lane\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dd43b6ec8f85bdee32ceaac59c48807f?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dd43b6ec8f85bdee32ceaac59c48807f?s=96&d=blank&r=g\",\"caption\":\"Jackson Lane\"},\"description\":\"I am an experienced Marketing Manager at MilesWeb UK, a leading web hosting company in the UK. With extensive knowledge in web hosting, WordPress, digital marketing, and web development, I'm committed to helping businesses succeed online. His expertise and enthusiasm for the digital world make him a valuable asset in the constantly changing field of online marketing.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/jackson-lane\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Docker on Ubuntu?","description":"Learn how to install Docker on Ubuntu with this step-by-step terminal guide. Set up the official repository, install Docker Engine, and run your first container.","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:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/","og_locale":"en_GB","og_type":"article","og_title":"How to Install Docker on Ubuntu?","og_description":"Learn how to install Docker on Ubuntu with this step-by-step terminal guide. Set up the official repository, install Docker Engine, and run your first container.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2026-08-28T11:42:34+00:00","article_modified_time":"2026-08-28T11:42:35+00:00","author":"Jackson Lane","twitter_misc":{"Written by":"Jackson Lane"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/","name":"How to Install Docker on Ubuntu?","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"datePublished":"2026-08-28T11:42:34+00:00","dateModified":"2026-08-28T11:42:35+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/1f580bdff0fa81720fae0fd0c3919758"},"description":"Learn how to install Docker on Ubuntu with this step-by-step terminal guide. Set up the official repository, install Docker Engine, and run your first container.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-install-docker-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to Install Docker on Ubuntu?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/1f580bdff0fa81720fae0fd0c3919758","name":"Jackson Lane","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/dd43b6ec8f85bdee32ceaac59c48807f?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd43b6ec8f85bdee32ceaac59c48807f?s=96&d=blank&r=g","caption":"Jackson Lane"},"description":"I am an experienced Marketing Manager at MilesWeb UK, a leading web hosting company in the UK. With extensive knowledge in web hosting, WordPress, digital marketing, and web development, I'm committed to helping businesses succeed online. His expertise and enthusiasm for the digital world make him a valuable asset in the constantly changing field of online marketing.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/jackson-lane\/"}]}},"views":0,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/17768","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=17768"}],"version-history":[{"count":1,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/17768\/revisions"}],"predecessor-version":[{"id":17769,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/17768\/revisions\/17769"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=17768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=17768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=17768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}