Running Docker Containers on a Raspberry Pi: A Step-by-Step Guide

Docker containers are lightweight and portable, making them a great tool for running applications in your homelab. A Raspberry Pi is an ideal low-cost, low-power device for hosting Docker containers. This guide will walk you through setting up Docker on a Raspberry Pi and deploying your first container. What You’ll Need A Raspberry Pi (recommended: Raspberry Pi 3, 4, or newer). MicroSD card with Raspberry Pi OS Lite installed. A stable internet connection. Basic knowledge of Linux commands. Step 1: Update and Prepare Your Raspberry Pi Log into your Raspberry Pi via SSH: ssh pi@<raspberry_pi_ip_address> Update and upgrade the system packages: sudo apt update && sudo apt upgrade -y Install prerequisite packages: sudo apt install -y apt-transport-https ca-certificates curl software-properties-common Step 2: Install Docker on the Raspberry Pi Download the official Docker installation script: curl -fsSL https://get.docker.com -o get-docker.sh Run the installation script: sudo sh get-docker.sh Add your user to the docker group (replace pi with your username if different): sudo usermod -aG docker pi Log out and back in to apply the changes. ...

2024-12-04 · 3 min

Setting Up a Kubernetes (K8s) Cluster at Home for Beginners

Kubernetes (K8s) is a powerful container orchestration platform used to manage applications at scale. Building a Kubernetes cluster in your homelab allows you to experiment with cloud-native concepts, deploy containerized applications, and learn skills for production-grade environments. In this guide, we’ll walk through setting up a basic Kubernetes cluster at home. What You’ll Need At least two devices (can be physical machines, VMs, or Raspberry Pis): One as a control plane (master node). One or more as worker nodes. Linux installed on each device (Ubuntu 20.04 or newer is recommended). A reliable network connection. Basic understanding of Linux commands. Step 1: Prepare the Nodes Install Ubuntu on all devices (or use your preferred Linux distro). Update and upgrade the system on each node: sudo apt update && sudo apt upgrade -y Set static IP addresses for all nodes to ensure stability in the cluster. Configure this via /etc/netplan or your router’s DHCP settings. Disable swap on all nodes to meet Kubernetes requirements: sudo swapoff -a To make it permanent, edit /etc/fstab and comment out the swap entry. 5. Install containerd as the container runtime: ...

2024-12-04 · 4 min