{"id":1411,"date":"2024-11-08T05:19:50","date_gmt":"2024-11-08T05:19:50","guid":{"rendered":"https:\/\/kb.lagonet.vn\/?p=1411"},"modified":"2024-11-09T09:17:59","modified_gmt":"2024-11-09T09:17:59","slug":"to-install-docker-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/kb.lagonet.vn\/?p=1411","title":{"rendered":"To Install Docker on Ubuntu 22.04"},"content":{"rendered":"\n<p>Using <code>apt-get install docker.io<\/code> is an alternative method, but it installs the version of Docker that comes with the default Ubuntu repositories. This version might be slightly older than the latest release from Docker\u2019s official repository. Here\u2019s a comparison and instructions if you&#8217;d prefer to go this route:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Option 1: Installing from the Default Ubuntu Repositories<\/h3>\n\n\n\n<p>The <code>docker.io<\/code> package in the default Ubuntu repositories is maintained by Ubuntu, so it may not be as up-to-date as the version directly from Docker.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install -y docker.io<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">After Installation Steps<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Start and Enable Docker:<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo systemctl start docker\n   sudo systemctl enable docker<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Check Docker Version:<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   docker --version<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Run Docker Without <code>sudo<\/code> (Optional):<\/strong> To allow running Docker commands without <code>sudo<\/code>, add your user to the <code>docker<\/code> group:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo usermod -aG docker $USER<\/code><\/pre>\n\n\n\n<p>Log out and back in or run <code>newgrp docker<\/code> to apply the group change.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Key Differences Between <code>docker.io<\/code> and Docker\u2019s Official Repository<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Versioning:<\/strong> <code>docker.io<\/code> might lag behind the latest release, which could lack new features or important bug fixes.<\/li>\n\n\n\n<li><strong>Updates:<\/strong> Using Docker\u2019s repository allows for quicker updates and access to new versions, as Docker maintains the repository directly.<\/li>\n<\/ul>\n\n\n\n<p>If you don\u2019t need the absolute latest version, <code>docker.io<\/code> is generally stable and sufficient for most use cases.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using apt-get install docker.io is an alternative method, but it installs the version of Docker that comes with the default [&hellip;]<\/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":"","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":"","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-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":"","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-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":"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":""},"mobile":{"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":""}},"footnotes":""},"categories":[141,142],"tags":[],"class_list":["post-1411","post","type-post","status-publish","format-standard","hentry","category-devops","category-docker"],"_links":{"self":[{"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=\/wp\/v2\/posts\/1411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1411"}],"version-history":[{"count":1,"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=\/wp\/v2\/posts\/1411\/revisions"}],"predecessor-version":[{"id":1412,"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=\/wp\/v2\/posts\/1411\/revisions\/1412"}],"wp:attachment":[{"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}