{"id":56,"date":"2023-08-05T07:05:47","date_gmt":"2023-08-05T07:05:47","guid":{"rendered":"http:\/\/it4home.dk\/?p=56"},"modified":"2023-12-03T14:18:17","modified_gmt":"2023-12-03T12:18:17","slug":"setting-up-docker-on-raspberry-pi-a-step-by-step-guide","status":"publish","type":"post","link":"https:\/\/it4home.dk\/index.php\/2023\/08\/05\/setting-up-docker-on-raspberry-pi-a-step-by-step-guide\/","title":{"rendered":"Setting up Docker on Raspberry Pi: A Step-by-Step Guide"},"content":{"rendered":"<div class=\"pdfprnt-buttons pdfprnt-buttons-post pdfprnt-top-right\"><a href=\"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/56?print=pdf\" class=\"pdfprnt-button pdfprnt-button-pdf\" target=\"_blank\" ><\/a><a href=\"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/56?print=print\" class=\"pdfprnt-button pdfprnt-button-print\" target=\"_blank\" ><img decoding=\"async\" src=\"https:\/\/it4home.dk\/wp-content\/plugins\/pdf-print\/images\/print.png\" alt=\"image_print\" title=\"Print Content\" \/><\/a><\/div>\n<p class=\"wp-block-paragraph\">Introduction:<br>Raspberry Pi is a versatile mini-computer, and with the growing popularity of containerization, using Docker on a Raspberry Pi can open up exciting possibilities. In this guide, we will walk you through the steps to set up Docker on your Raspberry Pi so that you can leverage the power of containerization for your projects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before you start:<br>Make sure you have a Raspberry Pi up and running with the Raspbian OS or its derivatives. Additionally, ensure you have a stable internet connection to proceed with the installation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step 1: Editing cmdline.txt<br>To enable memory control and avoid issues with mem management, we need to make some adjustments to the cmdline.txt file. Open the file using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/boot\/cmdline.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following lines at the end of the file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cgroup_enable=memory swapaccount=1 cgroup_memory=nokmem cgroup_enable=cpuset<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the changes and exit the editor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step 2: Adjusting GPU memory<br>To ensure smooth performance with Docker, it is recommended to allocate at least 128MB of GPU memory. Use the following steps to make the adjustment:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the raspi-config tool:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo raspi-config<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Navigate to &#8220;Advanced Options&#8221; and then &#8220;Memory Split.&#8221;<\/li>\n\n\n\n<li>Set the GPU memory to 128MB.<\/li>\n\n\n\n<li>Save the changes and exit the configuration tool.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Step 3: Updating your system<br>Before installing Docker, it&#8217;s essential to have your system up-to-date. Run the following commands to update your Raspberry Pi:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt upgrade -y\nsudo rpi-update\nsudo reboot\nsudo rpi-eeprom-update -a\nsudo reboot<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step 4: Installing Docker<br>Now, it&#8217;s time to install Docker on your Raspberry Pi. Execute the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo curl -fsSL https:\/\/get.docker.com -o get-docker.sh\nsudo sh get-docker.sh\nsudo reboot<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step 5: Granting permissions for Docker<br>To run Docker commands without using sudo, add your user to the &#8220;docker&#8221; group:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo groupadd docker\nsudo usermod -aG docker $USER<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure to log out and log back in to apply the changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Conclusion:<br>Congratulations! You have successfully set up Docker on your Raspberry Pi, allowing you to harness the power of containerization for your projects. Docker provides an efficient way to manage applications and services, making development and deployment a breeze on your Raspberry Pi. Enjoy exploring the world of containers and unleash the full potential of your tiny yet powerful computing companion.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction:Raspberry Pi is a versatile mini-computer, and with the growing popularity of containerization, using Docker on a Raspberry Pi can open up exciting possibilities. In this guide, we will walk you through the steps&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":371,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[2,7,31,29],"tags":[35],"class_list":["post-56","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","category-raspberry","category-server","category-virtual","tag-ok"],"_links":{"self":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":2,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":147,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/56\/revisions\/147"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/media\/371"}],"wp:attachment":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}