Post

After Spending A Lot Of Time Looking At Your Setups I Decided To Take The Plunge And Start This Hobby

After Spending A Lot Of Time Looking At Your Setups I Decided To Take The Plunge And Start This Hobby

After Spending A Lot Of Time Looking At Your Setups I Decided To Take The Plunge And Start This Hobby

1. Introduction

The blinking LEDs of a Raspberry Pi nestled next to your sofa represent more than just a hobby - they’re the gateway to mastering infrastructure management in its purest form. For seasoned DevOps engineers and system administrators, the homelab journey transforms theoretical knowledge into tangible expertise through hands-on experimentation with self-hosted infrastructure.

This deep dive into personal infrastructure management addresses the critical gap between cloud-centric workflows and bare-metal understanding. While enterprise environments abstract hardware through virtualization layers, the Raspberry Pi homelab forces confrontation with resource constraints, hardware limitations, and true infrastructure-as-code implementation - precisely why platforms like Jellyfin media servers gain traction in technical communities.

Through this 3000+ word manifesto, you’ll master:

  • ARM-based infrastructure design patterns
  • Containerization strategies for resource-constrained environments
  • Production-grade hardening of single-board computers
  • Performance optimization techniques for low-power hardware
  • Incremental scaling from Raspberry Pi to enterprise-grade hardware

Whether you’re deploying media servers or building Kubernetes testbeds, this guide transforms your “sofa server” into a professional learning platform that bridges the gap between homelab experimentation and production environments.

2. Understanding Homelab Infrastructure

2.1 The Evolution of Personal Infrastructure

Homelabs have evolved from basement server racks to sophisticated micro-infrastructures. The Raspberry Pi 5’s 8GB model delivers 2.4GHz quad-core ARM performance rivaling entry-level cloud instances at 1/10th the cost. This shift enables legitimate service hosting while maintaining silent, power-efficient operation.

2.2 Architectural Considerations

Key homelab design constraints differ dramatically from enterprise environments:

FactorEnterprise EnvironmentHomelab Environment
Power Budget500W-5kW per rack5-15W total
CoolingForced air, liquid coolingPassive/ambient
StorageSAN/NAS with RAIDSingle-disk with USB3
Networking10GbE+ with redundancy1GbE shared bandwidth
Failure ToleranceHA clustersBest-effort availability

2.3 Technology Comparison

When building ARM-based homelabs:

Containerization:

  • Docker: Ideal for single-service deployments (Jellyfin, Plex)
  • Podman: Rootless alternative for security-conscious setups
  • LXC: Lightweight system containers for full OS emulation

Orchestration:

  • k3s: Kubernetes optimized for ARM and low-resource environments
  • Docker Compose: Simplest multi-container management
  • Nomad: Flexible workload scheduler from HashiCorp

2.4 Real-World Use Cases

From Reddit’s “pi gang” examples to enterprise prototyping:

  • Media servers (Jellyfin/Plex) with hardware-accelerated transcoding
  • Network-wide ad blocking via Pi-hole
  • CI/CD pipeline runners (GitLab, Jenkins)
  • IoT data aggregation points
  • VPN endpoints with WireGuard or OpenVPN

3. Prerequisites

3.1 Hardware Requirements

Minimum viable Raspberry Pi 5 configuration:

1
2
3
4
5
6
# Verify hardware specs
$ cat /proc/cpuinfo | grep 'Model'
Model: Raspberry Pi 5 Model B Rev 1.0
$ free -h
              total used free
Mem:          7.6Gi 1.2Gi 6.4Gi

Recommended peripherals:

  • USB-C PD power supply (27W minimum)
  • Active cooling solution (thermal throttling occurs at 80°C)
  • UHS-III microSD card or USB3 SSD for OS
  • Aluminum case with passive cooling

3.2 Software Requirements

Base OS:

  • Raspberry Pi OS Lite (64-bit) Bullseye
  • Ubuntu Server 22.04 LTS for ARM64

Critical Packages:

1
2
3
# Essential build tools
$ sudo apt install build-essential libssl-dev zlib1g-dev \
  libffi-dev python3-dev python3-venv git curl

3.3 Security Preconfiguration

Before exposing services:

  1. Change default pi user password
  2. Configure SSH key authentication:
    1
    2
    
    $ ssh-keygen -t ed25519 -C "homelab@$HOSTNAME"
    $ ssh-copy-id pi@raspberrypi.local
    
  3. Enable UFW firewall:
    1
    2
    
    $ sudo ufw allow 22/tcp
    $ sudo ufw enable
    

3.4 Pre-Installation Checklist

  1. Flash OS image with Raspberry Pi Imager
  2. Resize filesystem to utilize full storage
  3. Configure static IP or DHCP reservation
  4. Update packages: sudo apt update && sudo apt upgrade -y
  5. Install performance monitor:
    1
    
    $ sudo apt install bmon htop iotop
    

4. Installation & Setup

4.1 Docker Engine Installation

Official Docker Repository Setup:

1
2
3
4
5
6
7
8
9
10
11
12
13
# Add Docker's GPG key
$ curl -fsSL https://download.docker.com/linux/debian/gpg | \
  sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

# Configure repository
$ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
  https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Install Docker components
$ sudo apt update
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin

Post-Install Configuration:

1
2
3
4
5
6
# Add user to docker group
$ sudo usermod -aG docker $USER

# Enable Docker's experimental features for ARM builds
$ echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json
$ sudo systemctl restart docker

4.2 Docker Compose Setup

Install Latest Version:

1
2
3
4
$ COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep tag_name | cut -d '"' -f 4)
$ sudo curl -L "https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" \
  -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose

4.3 Jellyfin Media Server Deployment

docker-compose.yml:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
version: '3.8'
services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
    volumes:
      - ./config:/config
      - /mnt/media:/data/media
    ports:
      - 8096:8096
      - 8920:8920 # HTTPS
    devices:
      - /dev/dri:/dev/dri # GPU passthrough
    restart: unless-stopped

Start Service:

1
2
$ docker-compose up -d
$ docker ps --format "table $CONTAINER_ID\t$CONTAINER_NAMES\t$CONTAINER_STATUS\t$CONTAINER_PORTS"

4.4 Verification Procedures

Service Health Check:

1
2
$ curl -sI http://localhost:8096 | grep HTTP
HTTP/1.1 200 OK

Hardware Acceleration Verification:

1
2
3
$ docker exec -it jellyfin /usr/bin/jellyfin ffmpeg -v debug
[...]
[AVHWDeviceContext @ 0x564e3b1d40] libva: VA-API version 1.15.0

5. Configuration & Optimization

5.1 Security Hardening

Non-Root Execution:

1
2
# docker-compose.yml snippet
user: "${UID}:${GID}"

Read-Only Filesystems:

1
2
3
4
5
6
services:
  jellyfin:
    read_only: true
    tmpfs:
      - /tmp
      - /var/log

Network Restrictions:

1
2
$ docker network create --internal isolated_nw
$ docker-compose --project-name isolated up -d

5.2 Performance Tuning

SD Card Longevity:

1
2
# Mount options in /etc/fstab
tmpfs /var/log tmpfs defaults,noatime,nosuid,nodev,noexec,mode=1777,size=100M 0 0

GPU Memory Allocation:

1
2
3
# In /boot/config.txt
gpu_mem=128
dtoverlay=vc4-kms-v3d

Container Resource Limits:

1
2
3
4
5
6
7
services:
  jellyfin:
    deploy:
      resources:
        limits:
          cpus: '2'
          memory: 4G

5.3 Monitoring Stack

Prometheus Configuration:

1
2
3
4
5
6
7
8
# prometheus.yml
scrape_configs:
  - job_name: 'node'
    static_configs:
      - targets: ['node_exporter:9100']
  - job_name: 'cadvisor'
    static_configs:
      - targets: ['cadvisor:8080']

Grafana Dashboard Import:

1
2
docker exec -it grafana grafana-cli dashboards import 1860 \
  --dashboard-name "Node Exporter Full"

6. Usage & Operations

6.1 Common Operations

Service Management:

1
2
3
4
5
6
7
8
# View running containers
$ docker ps --format "table $CONTAINER_ID\t$CONTAINER_NAMES\t$CONTAINER_IMAGE\t$CONTAINER_STATUS"

# Inspect container metadata
$ docker inspect $CONTAINER_ID | jq '.[].HostConfig'

# Stream logs
$ docker logs -f $CONTAINER_ID

Backup Procedures:

1
2
3
# Daily volume backup
$ docker run --rm -v jellyfin_config:/volume -v /backups:/backups \
  alpine tar -czf /backups/jellyfin-config-$(date +%Y-%m-%d).tar.gz -C /volume ./

6.2 Scaling Considerations

Vertical Scaling:

  1. Overclock CPU (add to /boot/config.txt):
    1
    2
    
    arm_freq=2400
    over_voltage_delta=50000
    
  2. Enable ZRAM swap:
    1
    2
    
    $ sudo apt install zram-tools
    $ echo 'ALGO=zstd' | sudo tee -a /etc/default/zramswap
    

Horizontal Scaling:

  1. Add secondary Pi nodes
  2. Configure Docker Swarm:
    1
    2
    
    $ docker swarm init --advertise-addr eth0
    $ docker node update --availability drain $NODE_ID
    

7. Troubleshooting

7.1 Common Issues

Permission Denied Errors:

1
$ docker run -it --rm -v /path:/data alpine chown -R 1000:1000 /data

Hardware Acceleration Failures:

1
$ LIBVA_DRIVER_NAME=k3d docker exec -it jellyfin vainfo

Network Conflicts:

1
2
$ docker network prune
$ sudo ss -tulpn | grep LISTEN

7.2 Diagnostic Commands

Container Inspection:

1
2
$ docker stats --no-stream
$ docker top $CONTAINER_ID

Performance Analysis:

1
2
$ perf top -p $(pidof jellyfin)
$ bpftrace -e 'tracepoint:syscalls:sys_enter_* { @[probe] = count(); }'

Log Investigation:

1
2
$ journalctl -u docker.service -f
$ docker exec $CONTAINER_ID dmesg -T

8. Conclusion

The Raspberry Pi homelab represents more than just cost-effective infrastructure - it’s a masterclass in constraint-driven engineering. Through this journey from sofa-side server to production-grade deployment, we’ve dissected the full lifecycle of self-hosted service management:

  1. Strategic hardware selection balancing power and performance
  2. Containerization techniques optimized for ARM architectures
  3. Enterprise-grade security practices adapted for micro-infrastructure
  4. Monitoring methodologies that reveal true resource utilization
  5. Scaling pathways from single-board computers to clustered environments

For continued learning:

The true value emerges not in the services hosted, but in the operational wisdom gained through constraints - lessons that translate directly to enterprise environments. Your homelab isn’t just a hobby; it’s the purest form of DevOps education.

This post is licensed under CC BY 4.0 by the author.