3 min read

Homelab 2.0: A Fresh Start with Better Planning & Automation

Homelab 2.0: A Fresh Start with Better Planning & Automation

One of my biggest homelab challenges has been poor planning, leading to unexpected downtime and lost configurations. Over time, this neglect accumulates, creating an environment full of tech debt. Instead of fighting an uphill battle, I decided to start fresh—with better documentation and automation.

As a hobbyist, how can I improve? Naturally I started over. Since my services were in disarray and I had no documentation to reference, starting over seemed like the best choice. I know that doesn't sound the like a great solution, but I'm all about new beginnings and improvements that come at a cost. I've spent the last two weeks thinking about what my infrastructure would look like, and documenting them in my other posts.

I'm one part computer gamer, so I have decades worth of old hardware that I've never disposed of, so I took some of the remnants and put together a 'new' server. I quickly reinstalled Proxmox VE on both servers, assigning names appropriate to their roles in the environment. I clustered both nodes in non-HA mode for a smoother user experience while also setting up Proxmox Backup Server on an old Lenovo laptop.

With some re-purposed hardware, and a fresh start I began my journey.

To keep deployments manageable, I grouped them into phases. My goal was to set up core networking first, followed by essential services, then monitoring and CI/CD. Below is the deployment breakdown, along with where each service is hosted:

Phase Service Host
1️⃣ Networking, Static IPs, NginxProxyManager Proxmox
2️⃣ Portainer Controller Proxmox
2️⃣ Portainer Agents Raspberry Pis
2️⃣ Elasticsearch Proxmox VM
2️⃣ Logstash, Kibana Raspberry Pis
3️⃣ Mimir Proxmox VM
3️⃣ Prometheus, Blackbox Exporter Raspberry Pis
3️⃣ Grafana Raspberry Pis
3️⃣ Beats Agents Raspberry Pis, Proxmox VM
4️⃣ Jenkins Controller Proxmox VM
4️⃣ Jenkins Agents Raspberry Pis, Proxmox VM
4️⃣ Github Actions Runner Raspberry Pis
4️⃣ Semaphore Raspberyy Pis
5️⃣ Github Actions Deployment Pipelines Github
5️⃣ NginxProxyManager Configuration Proxmox VM
6️⃣ Test Backups & Failover All

My eventual goal is to run the majority of services from containers on my Raspberry pi's, and back-end services in VM's (think mysql, postgres, dns). There are some services that need more durability and reliability than a container hosted on a pi, and ones that I'd feel more comfortable migrating, or restoring from a backup. For me, these make most sense to host on a virtual machine that I can manage more easily.

Great, we have a plan. I wrote some quick stories in Plane to track my work and began chipping away at them. Much of the prep work was done via the console, and I'll be the first to say that I dislike click-ops or console-ops. However, some tasks—like configuring my Cisco switch and setting up VLANs—were necessary to do in the UI. Finally, we can automate some of the deployments! I wrote some Ansible playbooks that would make deploying Portainer and Portainer agents on my raspberry pi's pain free. Previously, I had to manually install and configure Portainer. Now, a single command sets up the controller and agents across my Pis. What a relief.

---
- name: Deploy Portainer container
  docker_container:
    name: portainer
    image: portainer/portainer-ce:latest
    state: started
    restart_policy: always
    published_ports:
      - "8000:8000"
      - "9443:9443"
      - "9000:9000"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
      - "/opt/portainer/data:/data"

- name: Verify Portainer is running
  shell: "docker ps | grep portainer"
  register: portainer_status
  changed_when: false

- name: Display Portainer status
  debug:
    msg: "Portainer is running! Access it at https://{{ ansible_default_ipv4.address }}:9443"

Portainer deployment in Ansible

Starting over isn’t always the ideal solution, but in my case, it was the best way to build a cleaner, more automated homelab. By planning better and leveraging tools like Ansible, I’ve created a more structured approach that should prevent the same tech debt from creeping in again. The next step is refining my CI/CD setup and ensuring all services are properly backed up—because no homelab rebuild is truly finished!

Up next, provisioning logging with an Elastic stack, and monitoring with Grafana, Prometheus, and Mimir.