Overview

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)
  • Raspberry Pi 3B + HiFiBerry AMP+
  • Raspberry Pi 2B
  • Cloud Gateway Ultra
  • USW Flex Mini
  • U7 Lite AP

My Homelab

The top ThinkCentre is my WFH-computer and not part of the homelab.

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 1moode.deef.dk192.168.1.248:80Moode Audio
VLAN 1nginx.deef.dk192.168.1.204:81Proxy Manager
VLAN 1pi-hole.deef.dk192.168.1.127:80Ad Blocking
VLAN 1pi-hole2.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

TEST

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)"

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 Notice the local DNS records all point to the Nginx Proxy Manager IP-address, which will handle the requests.


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

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

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

My Home Assistant dashboard fits perfectly on a older iPad I got for cheap. Home Assistant Dashboard

Click here to see the full HA Dashboard YAML
type: sections
icon: mdi:button-pointer
cards: []
badges: []
subview: false
show_icon_and_title: true
max_columns: 2
sections:
  - type: grid
    cards:
      - square: true
        type: grid
        cards:
          - show_name: true
            show_icon: true
            type: button
            entity: switch.moode_socket_1
            show_state: true
            color: green
            name: HELL
            icon: mdi:monitor
          - show_name: true
            show_icon: true
            type: button
            entity: switch.moode_player_socket_1
            show_state: true
            color: green
            name: moOde
            icon: mdi:music
        columns: 2
        grid_options:
          rows: 4
          columns: 12
      - type: heading
        icon: mdi:server-network
        badges:
          - type: entity
            show_state: true
            show_icon: true
            entity: sensor.cpu_total_proxmox
            state_content: state
            icon: mdi:cpu-64-bit
            color: white
          - type: entity
            show_state: true
            show_icon: true
            entity: sensor.ram_total
            icon: mdi:memory
            state_content: state
            color: white
          - type: entity
            show_state: true
            show_icon: true
            entity: switch.proxmox_socket_1
            color: green
          - type: entity
            show_state: true
            show_icon: false
            entity: sensor.cluster_uptime
        heading_style: title
        grid_options:
          rows: auto
          columns: full
      - type: statistics-graph
        entities:
          - entity: sensor.192_168_1_10_package_id_0_temperature
            name: lv-426
            color: deep-orange
          - entity: sensor.192_168_1_11_package_id_0_temperature
            name: lv-223
            color: red
          - entity: sensor.192_168_1_12_package_id_0_temperature
            name: lv-178
            color: accent
        days_to_show: 5
        period: day
        chart_type: bar
        stat_types:
          - mean
        hide_legend: false
        expand_legend: false
        logarithmic_scale: false
        energy_date_selection: false
      - square: false
        type: grid
        columns: 3
        cards:
          - type: tile
            entity: sensor.192_168_1_10_package_id_0_temperature
            name: lv-426
            icon: mdi:thermometer
            color: deep-orange
            show_entity_picture: false
            hide_state: false
            vertical: false
            features:
              - type: trend-graph
                hours_to_show: 24
                detail: false
            features_position: bottom
          - type: tile
            entity: sensor.192_168_1_11_package_id_0_temperature
            name: lv-223
            icon: mdi:thermometer
            color: red
            show_entity_picture: false
            hide_state: false
            vertical: false
            features:
              - type: trend-graph
                hours_to_show: 24
                detail: false
            features_position: bottom
          - type: tile
            entity: sensor.192_168_1_12_package_id_0_temperature
            name: lv-178
            icon: mdi:thermometer
            color: accent
            show_entity_picture: false
            hide_state: false
            vertical: false
            features:
              - type: trend-graph
                hours_to_show: 24
                detail: false
            features_position: bottom
  - type: grid
    cards:
      - show_current: true
        show_forecast: true
        type: weather-forecast
        entity: weather.forecast_home
        forecast_type: hourly
        forecast_slots: 7
        round_temperature: true
        grid_options:
          columns: 12
          rows: 4
        secondary_info_attribute: wind_speed
      - type: heading
        icon: mdi:flash
        heading_style: title
        badges:
          - type: entity
            show_state: true
            show_icon: true
            entity: sensor.proxmox_total_energy
            color: purple
          - type: entity
            show_state: true
            show_icon: true
            entity: sensor.moode_player_total_energy
            color: green
          - type: entity
            show_state: true
            show_icon: true
            entity: sensor.moode_total_energy
            color: primary
          - type: entity
            show_state: true
            show_icon: true
            entity: sensor.total_power_usage
            state_content: state
            name: Total
            icon: ""
      - type: statistics-graph
        entities:
          - entity: sensor.proxmox_total_energy
            name: Proxmox Cluster
            color: purple
          - entity: sensor.moode_player_total_energy
            name: moOde Player
            color: green
          - entity: sensor.moode_total_energy
            name: HELL
            color: cyan
        days_to_show: 5
        period: day
        chart_type: bar
        stat_types:
          - change
        hide_legend: false
        expand_legend: false
        logarithmic_scale: false
        energy_date_selection: false
      - square: false
        type: grid
        columns: 3
        cards:
          - type: tile
            entity: sensor.proxmox_power
            name: Proxmox
            icon: mdi:thermometer
            color: purple
            show_entity_picture: false
            hide_state: false
            vertical: false
            features:
              - type: trend-graph
                hours_to_show: 24
                detail: false
            features_position: bottom
          - type: tile
            entity: sensor.moode_player_power
            name: moOde
            icon: mdi:thermometer
            color: green
            show_entity_picture: false
            hide_state: false
            vertical: false
            features:
              - type: trend-graph
                hours_to_show: 24
                detail: false
            features_position: bottom
          - type: tile
            entity: sensor.moode_power
            name: HELL
            icon: mdi:thermometer
            color: cyan
            show_entity_picture: false
            hide_state: false
            vertical: false
            features:
              - type: trend-graph
                hours_to_show: 24
                detail: false
            features_position: bottom
dense_section_placement: false
footer: {}

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 one post. I don’t always write into detail, but I hope you find at least some of it useful.