Home Infra

GitHub License GitHub License Docs-web workflow Docs-web workflow Dev Container workflow Dev Container workflow Pre-commit checks workflow Pre-commit checks workflow

This repository contains the Infrastructure as Code (IaC) configuration and documentation for a home infrastructure setup. The main goals are:

  • Creating a local, self-hosted environment for various services and applications, minimizing reliance on external cloud providers.
  • Learning and organizing knowledge, best practices, and tool documentation into a single repository.

Table of Contents

Principles

  • Automate Everything: Embrace the “cattle, not pets” approach by automating as much as possible to ensure consistency and reproducibility.
  • Prioritize Local Functionality: While cloud services may be utilized, the focus is on minimizing external dependencies and enabling local, cloud-independent functionality.
  • Minimal and Energy-efficient Hardware: Favor energy-efficient hardware solutions to reduce environmental impact and operational costs.
  • Avoid Overcomplication: Maintain a lightweight and straightforward setup by avoiding unnecessary complexities.
  • Extensibility and Easy Configuration: Ensure that the infrastructure is easily extensible and configurable to accommodate future changes and requirements.
  • Security-minded: Prioritize security best practices and implement appropriate measures to protect the infrastructure and data.

Key Software Components & Services

The key components of this infrastructure include:

Local Infrastructure Components

  • Proxmox Virtual Environment: A Type 1 hypervisor for managing virtual machines and containers.
  • Ubuntu Server: The host OS for running Docker containers and administrative tools.
  • Ansible: Used for configuring the host OS and deploying required software.
  • Docker Compose: For defining and managing Docker container configurations.
  • Traefik: A reverse proxy with TLS certificate management.
  • Authentik: Central identity provider for Google federation, native OIDC, and Traefik ForwardAuth, with local recovery accounts.
  • Guacamole: A web-based remote desktop and SSH access solution.
  • Homepage: A dashboard for managing and accessing various services.

Cloud Services (External Dependencies)

The long-term goal is to reduce these dependencies and provide offline alternatives.

NameDescriptionRemarks
Docker imagesAll services run as containersDownloaded on first use
Plugins, Modules (e.g., CrowdSec)Various plugins for servicesDownloaded on first use. TODO: create inventory
Large Language ModelsOptional, used by OllamaDownloaded on first use
OVHcloud (or other registrar)Domain name registrationRequired for remote access and TLS certificates. TODO: document fallback
CloudflareDNS zone administration, tunnelDNS administration is required by the documented TLS setup; tunnels are optional
Let’s EncryptTLS certificates (managed by Traefik)Required. TODO: document local CA setup for fallback
Backblaze B2Backup storageOptional, local backup also configured
CrowdSecCrowd-sourced IP blocklistOptional, security service, can be disabled
AzureTemporary VM, storageOptional, not used by any lab components
AWSEC2 VM, persistent EBS storageOptional, cloud deployment target
Homepage IconsIcon set for the servicesOptional, hosted on a CDN. TODO: host locally

Getting Started

Choose either bootstrap target explicitly; neither is the default. Follow the selected guide’s prerequisites before running initialization:

TargetStartInstallation guide
AWStask bootstrap:init TARGET=awsAWS installation
Proxmoxtask bootstrap:init TARGET=proxmoxProxmox installation

Both use native provisioning and configurable ordered Ansible roles, with one private operator-edited bootstrap.yaml, automatically converted to native inputs under generated/. Templates select Docker/Traefik/Homepage; set services: [] for a host without those applications and select only its needed roles. Service secrets are excluded from Terraform inputs. Pass the same TARGET on subsequent bootstrap commands; each target has its own default input/state directory. See configuration and safety. The underlying AWS EC2 Terraform configuration also supports standalone use.

Repository Layout

PathPurpose
ansible/Host playbooks, roles and public inventory defaults
docker/Service Compose files, organized by category
docs/Installation, configuration and operations guides
terraform/Standalone AWS and Azure provisioning templates
vm/VM provisioning scripts and hypervisor documentation
scripts/Service-management and maintenance utilities
tests/Offline regression tests
config/Ignored, host-specific inputs and private configuration
config-example/Configuration templates with placeholder values

Development

All development dependencies are available in the devcontainer or can be set up with an Ansible role.

Run commands from the repository root:

CommandPurpose
task --list-allDiscover the available tasks
task uiOpen the TaskUI task selector
task testRun the Python unit tests
task bootstrap:testRun only bootstrap Python and Proxmox shell tests
task lintRun all pre-commit checks
task buildRun tests/lint, regenerate Docker examples and build the documentation image
task cleanRemove generated documentation, Terraform caches/plans and Python virtual environments

Inspect Taskfile.yaml and its included task files before running build, cleanup or operational tasks: they can modify files and require Docker or host-specific inputs. For focused changes, run the relevant tests and pre-commit run --files <changed-files> instead of the full build.

For a single bootstrap check, use uv run --with-requirements scripts/requirements.txt python3 -m unittest tests.test_bootstrap.<Class>.<test_method>. task test runs all Python tests; task build runs those plus the Proxmox shell tests before linting and build steps.

Pre-commit checks shell scripts, YAML, Python, Ansible, Terraform and Dockerfiles, plus secrets and infrastructure security. The exact hooks are defined in .pre-commit-config.yaml.

Docker configuration, image updates and example .env generation are documented in Docker services. For operational utilities, see Usage.

GitHub automations

EOL

A crowd-sourced guide to help techs help their non-tech spouses / partners / parents / kids when we are at the end-of-life.

End-of-life Disaster Response