Skip to main content

Homelabbing

Table of Contents

Personal documentation for my homelab infrastructure. This documentation contains a consolidated overview of infrastructure, network topology and links to installation scripts.


Hardware
#

  • GeeekPi DeskPi RackMate T1
  • Lenovo ThinkCentre M920x, i5-9400T, 16 GB RAM, 256 GB NVMe (lv-426)
  • Lenovo ThinkCentre M920x, i5-8500, 16 GB RAM, 256 GB NVMe (lv-223)
  • Lenovo ThinkCentre M920x, i3-8100, 16 GB RAM, 256 GB NVMe (lv-178)
  • 2x Dell Wyse ThinClient (currently not in use)
  • Raspberry Pi 3B + HiFiBerry AMP+
  • Raspberry Pi 2B
  • Cloud Gateway Ultra
  • USW Flex Mini
  • U7 Lite AP

Network
#

Gateway/router/firewall: 192.168.1.1

SegmentHostnameIP / PortFunction / Type
VLAN 1ha.deef.dk192.168.1.103:8123Home Assistant
VLAN 1lv-426.deef.dk192.168.1.10:8006Proxmox Initial Node
VLAN 1lv-223.deef.dk192.168.1.11:8006Proxmox Node
VLAN 1lv-178.deef.dk192.168.1.12:8006Proxmox Node
VLAN 1port.deef.dk192.168.1.132:9443Docker Portainer
VLAN 1moode.deef.dk192.168.1.248:80Moode Audio
VLAN 1nginx.deef.dk192.168.1.204:81Proxy Manager
VLAN 1pihole.deef.dk192.168.1.127:80Ad Blocking
VLAN 1pihole2.deef.dk192.168.1.130:80Ad Blocking
VLAN 10-192.168.10.204IoT Device
VLAN 10-192.168.10.104IoT Device
VLAN 10-192.168.10.44IoT Device

Pi-hole
#

I’ve installed Pi-hole on two devices. By running two instances, I ensure that ad-blocking and local DNS resolution remain active even if one device goes offline or restarts.

For the Raspberry Pi, install with following commands:

git clone --depth 1 https://github.com/pi-hole/pi-hole.git Pi-hole
cd "Pi-hole/automated install/"
sudo bash basic-install.sh

Alternatively, you can install using curl:

curl -sSL https://install.pi-hole.net | bash

For the Proxmox node, install with Proxmox community helper script below.

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/pihole.sh)"
Don’t forget to assign 192.168.1.127 and 192.168.1.130 as the primary and secondary DNS servers on your router.

Adding the local DNS records to both pi-holes instances.

Pi-hole local DNS Records
Pi-hole local DNS Records

Note

Notice the local DNS records all point to the Nginx Proxy Manager IP-address, which will handle the requests.

Having to maintain multiple pi-hole instances can be cumbersome, so I setup nebula-sync to sync the pi-hole configuration across both devices.

On both pi-hole instances, configure an app password in the web interface and enable webserver.api.app_sudo.

pihole-webinterface-api-add-app-password
pihole-webinterface-api-add-app-password
pihole-webserver-api-app-sudo
pihole-webserver-api-app-sudo

Tip

If you don’t see the option, make sure you enable Expert Mode.

In Portainer, add a new stack. Give it a name and paste the following YAML configuration.

---
services:
  nebula-sync:
    image: ghcr.io/lovelaze/nebula-sync:latest
    container_name: nebula-sync
    environment:
    - PRIMARY=https://pihole.deef.dk|Your App Password
    - REPLICAS=https://pihole2.deef.dk|Your App Password
    - FULL_SYNC=true
    - RUN_GRAVITY=true
    - CRON=0 * * * *

Nginx Proxy Manager
#

Install with Proxmox community helper script below.

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/nginxproxymanager.sh)"

Setting up the DNS records on Cloudflare.

;Type    Name          Content          Proxy 
A        deef.dk       192.168.1.204    DNS Only - reverse IP
CNAME    *deef.dk      deef.dk          DNS Only

Configuring Let’s Encrypt SSL Certificate:

TLS Certificate
Create SSL Certificate

Start adding your first Proxy Hosts.

Add your first Proxy Host
Add your first Proxy Host

Tip

Sometimes depending on the service you’re proxying, you may need to play around with the settings.

For example, Home Assistant requires you to select WebSocket Support. And sometimes the scheme needs to be set to http instead of https.

Select the SSL certificate you previously created.

SSL Certificate Selected
SSL Certificate Selected

You should now be able to access your services without using the IP-addresses. No more site not secure warnings and easy rememberable URLs like ha.deef.dk.

Everything is set up to run locally. If you do a nslookup on ha.deef.dk, you will only see the local IP-address, not the external IP-address. Even if you’re trying to access the service from outside your local network.

Cloudflare acts as a reverse proxy and handles TLS termination. If you don’t have a domain, you can use a free service like DuckDNS.


Home Assistant
#

HA is installed as a VM on Proxmox with this helper script.

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/vm/haos-vm.sh"

For Home Assistant to work with reverse proxy, you need to add the following to the configuration.yaml file.

# configuration.yaml
http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 192.168.1.204 # <- Your reverse proxy IP here
Home Assistant Dashboard
The Home Assistant dashboard fits perfectly on a older iPad.

Resources
#


Conclusion
#

This post got a bit long, but having separated posts about my homelab just didn’t make sense, so I decided to put everything in this single post. I don’t always write into detail, but I hope you find at least some of it useful.

I will continue to update this post as I make changes to my homelab. As we all know, the homelabbing never finishes. 😅

Related

My First Post

·278 words·2 mins
This is my first post. Website is made with Hugo and the theme is Blowfish. I will be updating this post with stuff I learn along the way. Below is a short list of tools I used to make this website. Favicon.io I used this very handy website to generate logo and favicon.