{"id":19470,"date":"2023-06-18T12:46:26","date_gmt":"2023-06-18T12:46:26","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=19470"},"modified":"2023-10-18T12:49:55","modified_gmt":"2023-10-18T12:49:55","slug":"how-to-uninstall-docker-on-ubuntu","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-uninstall-docker-on-ubuntu\/","title":{"rendered":"How to Uninstall Docker on Ubuntu"},"content":{"rendered":"<p><img decoding=\"async\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-1024x878.jpg\" alt=\"How to Uninstall Docker on Ubuntu\" width=\"1024\" height=\"878\" class=\"alignnone size-large wp-image-19471 lazyload\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-1024x878.jpg 1024w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-300x257.jpg 300w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-128x110.jpg 128w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-420x360.jpg 420w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-540x463.jpg 540w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-720x617.jpg 720w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-960x823.jpg 960w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-1140x977.jpg 1140w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-1166x999.jpg 1166w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-840x720.jpg 840w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu-1260x1080.jpg 1260w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2023\/10\/How-to-Uninstall-Docker-on-Ubuntu.jpg 1400w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/878;\" \/><\/p>\n<p>Docker has revolutionized the way applications are developed, shipped, and deployed. However, there might be instances where you need to uninstall Docker from your system, perhaps to reinstall it or to free up resources.<\/p>\n<p>In this guide, we&#8217;ll walk you through the steps to completely remove Docker from an <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-ubuntu-beginners-guide-ubuntu-linux-distro\/\">Ubuntu system<\/a>.<\/p>\n<p>Let&#8217;s get started.<\/p>\n<h2>Step 1: Stop All Running Docker Containers<\/h2>\n<p>Before uninstalling Docker, ensure that all Docker containers are stopped.<\/p>\n<pre>\r\nsudo docker stop $(sudo docker ps -aq)\r\n<\/pre>\n<p>This command stops all running Docker containers by listing all containers with docker ps -aq and then stopping them with docker stop.<\/p>\n<h2>Step 2: Remove Docker Packages<\/h2>\n<p>Next, uninstall Docker packages using the package manager.<\/p>\n<pre>\r\nsudo apt-get purge docker-ce docker-ce-cli containerd.io\r\n<\/pre>\n<p>This command will remove Docker but retain the configuration files and images.<\/p>\n<h2>Step 3: Remove Docker Configuration and Image Files<\/h2>\n<p>If you want to remove all Docker configurations, images, and volumes, you can delete the Docker directory.<\/p>\n<pre>\r\nsudo rm -rf \/var\/lib\/docker\r\n<\/pre>\n<p>Be cautious with this step, as it will delete all your Docker images, containers, volumes, and configurations.<\/p>\n<h2>Step 4: Remove Docker Dependencies<\/h2>\n<p>Docker might have installed dependencies that are no longer used. You can remove them with:<\/p>\n<pre>\r\nsudo apt-get autoremove\r\n<\/pre>\n<h2>Step 5: Remove Docker GPG Key<\/h2>\n<p>Docker&#8217;s GPG key was added during the Docker installation to ensure the integrity of the downloaded packages. To remove it:<\/p>\n<pre>\r\nsudo apt-key del $(sudo apt-key list | grep Docker | awk '{print $2}')\r\n<\/pre>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">sudo docker stop $(sudo docker ps -aq)<\/span> \u2013 Stops all running Docker containers.<\/li>\n<li><span class=\"fw-bold\">sudo apt-get purge docker-ce docker-ce-cli containerd.io<\/span> \u2013 Removes Docker packages.<\/li>\n<li><span class=\"fw-bold\">sudo rm -rf \/var\/lib\/docker<\/span> \u2013 Deletes Docker configurations, images, and volumes.<\/li>\n<li><span class=\"fw-bold\">sudo apt-get autoremove<\/span> \u2013 Removes unused dependencies.<\/li>\n<li><span class=\"fw-bold\">sudo apt-key del $(sudo apt-key list | grep Docker | awk &#8216;{print $2}&#8217;)<\/span> \u2013 Removes Docker&#8217;s GPG key.<\/li>\n<\/ul>\n<h2>FAQ<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">Why might I need to uninstall Docker?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">There could be several reasons, such as needing to reinstall Docker, resolving conflicts, freeing up system resources, or transitioning to a different containerization tool.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">Is it safe to delete the \/var\/lib\/docker directory?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Yes, but it will remove all Docker images, containers, volumes, and configurations. Ensure you have backups of necessary data before proceeding.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">Can I reinstall Docker after uninstalling?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Absolutely! Uninstalling Docker doesn&#8217;t prevent you from reinstalling it in the future.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">Will uninstalling Docker affect other software on my system?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">No, uninstalling Docker should not affect other software. However, any applications running inside Docker containers will be affected.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How can I verify that Docker has been completely removed?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can check by trying to run Docker commands or checking for its service. If they don&#8217;t respond or show errors, Docker has likely been removed.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n<h2>Conclusion<\/h2>\n<p>Uninstalling Docker from Ubuntu is a straightforward process, but it&#8217;s essential to follow the steps carefully to ensure a complete removal.<\/p>\n<p>Whether you&#8217;re transitioning to a different containerization tool or merely freeing up system resources, this guide has provided you with the necessary steps to uninstall Docker safely.<\/p>\n<p>If you&#8217;re exploring different hosting solutions, don&#8217;t forget to check out our guides on <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-dedicated-server-hosting\/\">dedicated server hosting<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-vps-hosting\/\">VPS hosting<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-cloud-hosting\/\">cloud hosting<\/a>, and <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-shared-hosting\/\">shared hosting<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker has revolutionized the way applications are developed, shipped, and deployed. However, there might be instances where you need to uninstall Docker from your system, perhaps to reinstall it or&#8230;<\/p>\n","protected":false},"author":6,"featured_media":19471,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1073],"tags":[2120,1856],"class_list":["post-19470","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-docker","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/19470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=19470"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/19470\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/19471"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=19470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=19470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=19470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}