{"id":242,"date":"2021-10-07T22:21:03","date_gmt":"2021-10-07T21:21:03","guid":{"rendered":"https:\/\/www.bolukan.nl\/?p=242"},"modified":"2021-10-07T22:42:44","modified_gmt":"2021-10-07T21:42:44","slug":"installing-raspberry-pi-os","status":"publish","type":"post","link":"https:\/\/www.bolukan.nl\/?p=242","title":{"rendered":"Installing Raspberry Pi OS"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This is an instruction to install Raspberry Pi OS for use with Docker. Keep in mind that things will change and steps in the instruction will no longer be correct anymore.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prepare SD card<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Raspberry PI offers software to easily burn the <a rel=\"noreferrer noopener\" href=\"https:\/\/www.raspberrypi.com\/software\/\" target=\"_blank\">Raspberry PI OS<\/a> on a SD card. I chose the headless Raspberry Pi OS Lite without desktop.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create an empty file &#8220;ssh&#8221; in boot partition to be able to SSH into the headless OS after installation.<br>Create file &#8220;wpa_supplicant.conf&#8221; in boot to add WiFi. The example need to be adjusted with the right credentials.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">country=NL<br>ctrl_interface=DIR=\/var\/run\/wpa_supplicant GROUP=netdev<br>update_config=1<br><br>network={<br>ssid=\"myssid\"<br>psk=\"mypassword\"<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">SETUP Raspberry Pi OS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Boot your Raspberry Pi.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use SSH to login. I like <a rel=\"noreferrer noopener\" href=\"https:\/\/www.9bis.net\/kitty\/#!index.md\" target=\"_blank\">KiTTY<\/a> as client, an alternative for <a rel=\"noreferrer noopener\" href=\"https:\/\/www.putty.org\/\" target=\"_blank\">PuTTY<\/a>. KiTTY is installed on the NAS with <a rel=\"noreferrer noopener\" href=\"https:\/\/www.9bis.net\/kitty\/#!pages\/Portability.md\" target=\"_blank\">local configuration<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The default user is <em>pi<\/em> with password <em>raspberry<\/em>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>STEP 1: Change some settings:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo raspi-config<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>1. System Options &#8211; S3 Password: Change password &#8216;raspberry&#8217; for the &#8216;pi&#8217; user<\/li><li>1. System Options &#8211; S4 Hostname: Set name for this computer on a network<\/li><li>5. Localisation Options: L1 Locale: Configure language and regional settings. <em>I prefer en-GB.UTF-8.<\/em><\/li><li>5. Localisation Options: L2 Timezone: Configure time zone. <em>I prefer Europe\/Amsterdam<\/em>.<\/li><li>5. Localisation Options: L4 WLAN Country: Set legal wireless channels for your country. <em>I already set NL Netherlands within wpa_supplicant.conf.<\/em><\/li><li>6 Advanced Options \/ A1 Expand Filesystem: Ensures that all of the SD card is available<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Reboot the Pi and login again.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>STEP 2: Update OS:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt update -y<br>$ sudo apt upgrade -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Get a coffee.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>STEP 3: Install packages:<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Install GIT<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">With Raspberry OS Lite, install GIT:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt-get install git -y<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Install Docker<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">$ curl -fsSL https:\/\/get.docker.com -o docker.sh\n$ sudo sh docker.sh\n$ sudo usermod -aG docker pi\n$ logout<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and login again. After the new login the new group setting for user pi is active.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em><strong><a rel=\"noreferrer noopener\" href=\"https:\/\/curl.se\/\" target=\"_blank\">curl<\/a><\/strong> <span class=\"has-inline-color has-vivid-cyan-blue-color\">command line tool and library for transferring data with URLs\n<strong>-fsSL -f<\/strong> (HTTP) Fail silently (no output at all) on server errors, <strong>-s<\/strong> Silent or quiet mode, <strong>-S<\/strong> When used with -s, --silent, it makes curl show an error message if it fails, <strong>-L<\/strong> If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place.\n<strong>-o<\/strong> Write output to instead of stdout.\n<strong>sh <\/strong>Execute shell script\n<strong>usermod<\/strong> modify a user account\n<strong>-aG<\/strong> <strong>-a<\/strong> Add the user to the supplementary group(s). Use only with the -G option. <strong>-G<\/strong> A list of supplementary groups which the user is also a member of. <\/span><\/em><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Install Portainer<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo docker run -d -p 8000:8000 -p 9443:9443 --name=portainer-ce --restart=always -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -v portainer_data:\/data portainer\/portainer-ce:latest<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">open browser https:\/\/x.x.x.x:9443\/ and set the password.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"has-inline-color has-vivid-cyan-blue-color\"><em><strong>sudo<\/strong> run as superuser\n<strong>docker<\/strong> execute docker\n<strong><a rel=\"noreferrer noopener\" href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/run\/\" target=\"_blank\">run<\/a><\/strong> the command to start a container process that will run isolated in that it has its own file system, its own networking, and its own isolated process tree separate from the host.\n<strong>-d<\/strong> Run container in background and print container ID\n<strong>-p 8000:8000<\/strong> Publish a container's port(s) to the host. Port <code>8000<\/code> is a TLS tunnel server used to create a secure tunnel between the edge agent and the Portainer instance.\n<strong>-p 9443:9443<\/strong> Publish a container's port(s) to the host. HTTPS is enabled by default on port <code>9443<\/code>\n<strong>--name=portainer-ce<\/strong> Assign a name to the container\n<strong>--restart=always<\/strong> Restart policy to apply when a container exits\n<strong>-v \/var\/run\/docker.sock:\/var\/run\/docker.sock<\/strong> Bind mount a volume, the Unix socket the Docker daemon listens on by default, and it can be used to communicate with the daemon from within a container.\n<strong>-v portainer_data:\/data<\/strong> Bind mount a volume, to Persist Portainer data.\n<strong>portainer\/portainer-ce:latest<\/strong> image<\/em><\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is an instruction to install Raspberry Pi OS for use with Docker. Keep in mind that things will change and steps in the instruction will no longer be correct anymore. Prepare SD card Raspberry PI offers software to easily burn the Raspberry PI OS on a SD card. I chose the headless Raspberry Pi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-242","post","type-post","status-publish","format-standard","hentry","category-esp8266"],"_links":{"self":[{"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/posts\/242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=242"}],"version-history":[{"count":11,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/posts\/242\/revisions"}],"predecessor-version":[{"id":270,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=\/wp\/v2\/posts\/242\/revisions\/270"}],"wp:attachment":[{"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bolukan.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}