Skip to content

Latest commit

Β 

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Homelab

A fully automated, themed homelab built with Proxmox, Terraform, and Docker.


This homelab infrastructure is centered on Proxmox VE using Terraform and Docker to provision VMs and Dockers (names based in the Angels from Neon Genesis Evangelion). Each VM serves a specific purpose like media, storage, or network automation.

πŸ”§ System Configuration

Refer to the table below for an at-a-glance view of each configured and planned virtual machine and its corresponding role.

These steps are tailored specifically to my homelab infrastructure. Some assumptions are made (like Proxmox being pre-installed), and tools are selected based on personal preference and workflow. Your configuration may vary depending on your hardware, network design, and requirements.

  • Proxmox VE is already installed and fully configured in this environment.
  • Create new SSH Key for setup conectivity.
  • Use Proxmox VE Helper Scripts for community-contributed helper scripts for VM management, backups, and more.
  • Setup Traefik as a reverse proxy to handle and redirect HTTP/S traffic.

πŸ”‘ SSH Key & Certificate Generation

Generate an SSH key for your vm's or other services:

ssh-keygen -t ed25519 -C "server"

Use the generated public key in user-data for automatic authentication setup.

🌐 Proxy Configuration (Traefik)

Using traefik-kop, each VM runs an agent that:

  • Registers itself with the main Traefik instance
  • Sends its routing configuration dynamically

This enables:

  • Auto-discovery of services
  • Clean URLs and HTTPS support
  • Centralized control over routing logic
                       
                      +-------------------------+         +---------------------0----+
                      | +---------------------+ |         | +---------------------+  |
                      | |                     | |         | |                     |  |
+---------+     :443  | |  +---------+        | | :8088   | |  +------------+     |  |
|   WAN   |--------------->| traefik |<-------------------->|  | svc-nginx  |     |  |
+---------+           | |  +---------+        | |         | |  +------------+     |  |
                      | |       |             | |         | |                     |  |
                      | |  +---------+        | |         | |  +-------------+    |  |
                      | |  |  redis  |<-------------------->|  | traefik-kop |    |  |
                      | |  +---------+        | |         | |  +-------------+    |  |
                      | |             docker1 | |         | |             docker2 |  |
                      | +---------------------+ |         | +---------------------+  |
                      |                     vm1 |         |                    vm2   |
                      +-------------------------+         +--------------------------+

πŸ“ NFS Configuration

Optional - Share Storage

Note

⚠️ NTFS support is functional but comes with performance and permission caveatsβ€”consider ext4/ZFS for native setups.

To consolidate data across VMs, I export a shared storage path via NFS, backed by an NTFS-formatted disk. While not typical in Linux-first setups, this suits my personal needs.

sudo apt install -y ntfs-3g

List all the devices and select which one you need to mount.

sudo fdisk -l
sudo lsblk -f
ls -l /dev/disk/by-uuid/

Copy the UUID in /etc/fstab

# edit fstab
vim /etc/fstab
UUID="" /mnt/storage ntfs-3g defaults,auto 0 0
mkdir /mnt/storage
# mount disc
mount -a
  • Add disk to VM.
ls -l /dev/disk/by-id/
qm set 103 -virtio2 /dev/disk/by-id/<disk-id>

1. Install NFS Server

sudo apt install -y nfs-kernel-server
sudo vim /etc/exports

Example export entry:

/mnt/storage 192.168.1.0/24(rw,sync,no_subtree_check)
  • Replace 192.168.1.0/24 with the subnet of your Proxmox server (e.g., 192.168.1.0/24 allows all IPs in the 192.168.1.x range).
  • rw: Allows read and write access.
  • sync: Ensures changes are written to disk before the client is notified.
  • no_subtree_check: Prevents subtree checking for better performance.

2. Add NFS Storage to Proxmox

  1. Login to Proxmox Web UI

  2. Navigate to Datacenter > Storage > Add > NFS

  3. Fill in:

    • ID: Enter a name for the storage (e.g., nfs-storage).
    • Server: Enter the IP address of the NFS server (e.g., 192.168.1.111).
    • Export: Click Query to list available NFS exports, and select /mnt/storage.
    • Content: Select the types of content you want to store (e.g., Disk image, ISO image, Backup).
    • Nodes: Select the Proxmox nodes that can access this storage.

🧱 Base VMs with Packer

Warning

⚠️ To be able to run packer from WSL2 you need to change the network mode.

All virtual machines are built from a cloud-init Ubuntu 24.04 image using Packer. This ensures consistency across deployments.

Configure variables.auto.pkrvars.hcl file for custom values.

cd packer
packer validate .
packer build .
  • The resulting image is uploaded to Proxmox as a VM template.
  • Cloud-init is enabled in the build to support dynamic configuration.
  • Include Docker installation an other tools.
  • This template is later used by Terraform to deploy actual VMs.

πŸš€ VM Deployment with Terraform

Deploy or destroy VMs using Terraform's targeted apply.

Ensure that your terraform.tfvars and modules are configured per Proxmox Provider standards.

cd terraform
terraform plan
terraform apply
# or 
terraform apply -target='module.vms["ramiel"]'
terraform destroy -target='module.vms["ramiel"]'

πŸ“¦ VMs

Thumbnail VM Name ID Category Services/Tools
Adam 201 Proxmox Host Proxmox VE
Lilith 202 Storage TrueNAS*
Sachiel 203 Media Server Plex / Jellyfin / Plextraktsync / Navidrome
Shamshel 204 Arr Stack Sonarr / Radarr / Lidarr / Prowlarr / Overseerr
Ramiel 205 Downloaders Transmission
Gaghiel 206 Reverse Proxy and Tunnels Traefik / CloudflareTunnels
Israfel 207 NFS Server NFS*
Sandalphon 208 Network tools Gluetun / Flaresolverr
Matarael 209 Dashboards Homepage / Homarr / Homer
Sahaquiel 210 Monitoring Uptimekuma / Dozzle
Ireul 211 Utilities Home Assistant / Immich / Paperless

[*]: Future changes or upgrades.

βš™οΈ Configuration

Transmission and OpenVPN

  • For testing Transmission with OpenVPN add this torrent from TorGuard.

Home Assistant

Windows Share with Rclone

# Installing
winget install --id=Rclone.Rclone -e
# Setup new SFTP connection
rclone config
# Show all volumes
rclone listremotes
# Mount
rclone mount nas:/mnt/storage X: --vfs-cache-mode full --vfs-cache-max-size 2G --vfs-read-chunk-size 64M --vfs-read-chunk-size-limit 512M --buffer-size 32M --attr-timeout 1s --no-modtime --network-mode --dir-cache-time 5m --poll-interval 10s --log-level INFO
  • Copy files
rclone copy "F:/" nas:"/mnt/storage/backup/" --progress

πŸ”— References


✦ Inspired by Evangelion. Built for learning, automation, and chaos. ✦

Contributors

Languages