{"id":390,"date":"2025-02-04T15:41:29","date_gmt":"2025-02-04T21:41:29","guid":{"rendered":"https:\/\/bblaze.xyz\/?p=390"},"modified":"2025-12-08T16:06:46","modified_gmt":"2025-12-08T22:06:46","slug":"installing_docker","status":"publish","type":"post","link":"https:\/\/jb03.com\/index.php\/2025\/02\/04\/installing_docker\/","title":{"rendered":"Installing Docker"},"content":{"rendered":"\n<p>Docker is a very nifty application that allows you to run other applications inside &#8220;containers&#8221;.<\/p>\n\n\n\n<p>We are going to need Docker to run some other applications down the road. So now is a good time to install it.<\/p>\n\n\n\n<p>To do this we are going to need to run a few commands. So scared of your favorite SSH client and log into the server.<\/p>\n\n\n\n<p>We are going to follow the steps outlined in the <a href=\"https:\/\/docs.docker.com\/engine\/install\/\">official documentation<\/a> for our <a href=\"https:\/\/docs.docker.com\/engine\/install\/ubuntu\/\">Ubuntu server<\/a> hosted at Digital Ocean.<\/p>\n\n\n\n<p>NOTE: if you&#8217;re not using Ubuntu, you CANNOT use the commands below. Your software can keys will be different. Please check the <a href=\"https:\/\/docs.docker.com\/engine\/install\/\">official documentation<\/a>.<\/p>\n\n\n\n<p>Before moving on we need to talk about Ubuntu and the sudo command.<\/p>\n\n\n\n<p>\u2013 If you have installed Ubuntu on a piece of bare-metal like an old computer you found in the basement or a Raspberry Pi, then during the installation process Ubuntu will have asked you to create an admin user. That means you log into your Ubuntu server with that username &amp; not root. If that&#8217;s the case, then you will need to use the sudo command.<\/p>\n\n\n\n<p>\u2013 If you have installed Ubuntu on a VPS server like the Digital Ocean droplet we created in a previous post, when you are likely logging into your Ubuntu server as root. If that&#8217;s the case, then you will NOT need to use the sudo command. Although, while older versions of Ubuntu used to scream at you, it appears the current version just simply ignores the sudo if it&#8217;s not needed. (An explanation was needed because I don&#8217;t use it in my screenshots.)<\/p>\n\n\n\n<p>For those of you who have logged in as a user with admin rights, your commands are going to look like this.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Add Docker's official GPG key:\nsudo apt-get update\nsudo apt-get install ca-certificates curl\nsudo install -m 0755 -d \/etc\/apt\/keyrings\nsudo curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg -o \/etc\/apt\/keyrings\/docker.asc\nsudo chmod a+r \/etc\/apt\/keyrings\/docker.asc\n\n# Add the repository to Apt sources:\necho \\\n  \"deb &#91;arch=$(dpkg --print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.asc] https:\/\/download.docker.com\/linux\/ubuntu \\\n  $(. \/etc\/os-release &amp;&amp; echo \"$VERSION_CODENAME\") stable\" | \\\n  sudo tee \/etc\/apt\/sources.list.d\/docker.list > \/dev\/null\nsudo apt-get update\n\n# Install the Packages \nsudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/code><\/pre>\n\n\n\n<p>. . .<\/p>\n\n\n\n<p>For those of you who login as root, your commands are going to look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Add Docker's official GPG key:\napt-get update\napt-get install ca-certificates curl\ninstall -m 0755 -d \/etc\/apt\/keyrings\ncurl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg -o \/etc\/apt\/keyrings\/docker.asc\nchmod a+r \/etc\/apt\/keyrings\/docker.asc\n\n# Add the repository to Apt sources:\necho \\\n  \"deb &#91;arch=$(dpkg --print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.asc] https:\/\/download.docker.com\/linux\/ubuntu \\\n  $(. \/etc\/os-release &amp;&amp; echo \"$VERSION_CODENAME\") stable\" | \\\n  tee \/etc\/apt\/sources.list.d\/docker.list > \/dev\/null\napt-get update \n\n# Install the Packages\napt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/code><\/pre>\n\n\n\n<p>. . .<\/p>\n\n\n\n<p>Working with the Ubuntu server previously created at Digital Ocean, running those commands looks like this:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/jb03.com\/wp-content\/uploads\/2025\/02\/install-Doctor-1024x605.png\" alt=\"\" class=\"wp-image-407\"\/><\/figure>\n<\/div>\n\n\n<p>The server does not give you a lot of feedback running those commands. But when you actually go to install Docker you get more information like this:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"405\" src=\"https:\/\/jb03.com\/wp-content\/uploads\/2025\/02\/install-Doctor-twon-1024x405.png\" alt=\"\" class=\"wp-image-408\" srcset=\"https:\/\/jb03.com\/wp-content\/uploads\/2025\/02\/install-Doctor-twon-1024x405.png 1024w, https:\/\/jb03.com\/wp-content\/uploads\/2025\/02\/install-Doctor-twon-300x119.png 300w, https:\/\/jb03.com\/wp-content\/uploads\/2025\/02\/install-Doctor-twon-768x304.png 768w, https:\/\/jb03.com\/wp-content\/uploads\/2025\/02\/install-Doctor-twon.png 1399w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Before the system makes any changes it&#8217;s going to require you to hit Y or enter.<\/p>\n\n\n\n<p>After that, there&#8217;s probably a screen or two of scrolling and notifications. If services need to be restarted go ahead and restart them.<\/p>\n\n\n\n<p>When you&#8217;re done it wouldn&#8217;t hurt to reboot the whole system.<\/p>\n\n\n\n<p>If everything went well you should be able to run the following command &amp; have this result:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker run hello-world<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"901\" height=\"565\" src=\"https:\/\/jb03.com\/wp-content\/uploads\/2025\/02\/install-Doctor-3.png\" alt=\"\" class=\"wp-image-409\" srcset=\"https:\/\/jb03.com\/wp-content\/uploads\/2025\/02\/install-Doctor-3.png 901w, https:\/\/jb03.com\/wp-content\/uploads\/2025\/02\/install-Doctor-3-300x188.png 300w, https:\/\/jb03.com\/wp-content\/uploads\/2025\/02\/install-Doctor-3-768x482.png 768w\" sizes=\"auto, (max-width: 901px) 100vw, 901px\" \/><\/figure>\n<\/div>\n\n\n<p>Congratulations! You&#8217;ve just installed Docker.<\/p>\n\n\n\n<p>Now we can do some cool stuff.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker is a very nifty application that allows you to run other applications inside &#8220;containers&#8221;. We &hellip; <a title=\"Installing Docker\" class=\"hm-read-more\" href=\"https:\/\/jb03.com\/index.php\/2025\/02\/04\/installing_docker\/\"><span class=\"screen-reader-text\">Installing Docker<\/span>Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,36],"tags":[],"class_list":["post-390","post","type-post","status-publish","format-standard","hentry","category-docker","category-getting-started"],"_links":{"self":[{"href":"https:\/\/jb03.com\/index.php\/wp-json\/wp\/v2\/posts\/390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jb03.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jb03.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jb03.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jb03.com\/index.php\/wp-json\/wp\/v2\/comments?post=390"}],"version-history":[{"count":1,"href":"https:\/\/jb03.com\/index.php\/wp-json\/wp\/v2\/posts\/390\/revisions"}],"predecessor-version":[{"id":637,"href":"https:\/\/jb03.com\/index.php\/wp-json\/wp\/v2\/posts\/390\/revisions\/637"}],"wp:attachment":[{"href":"https:\/\/jb03.com\/index.php\/wp-json\/wp\/v2\/media?parent=390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jb03.com\/index.php\/wp-json\/wp\/v2\/categories?post=390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jb03.com\/index.php\/wp-json\/wp\/v2\/tags?post=390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}