Hub
Terraform & OpenTofu for On-Prem, Homelab & Network Gear
Terraform and OpenTofu guides for Proxmox, Hyper-V, vSphere, Nutanix, XCP-ng, TrueNAS, Synology and Unraid, plus Cisco, Juniper, Arista and MikroTik.
- Hypervisors
- NAS
- Network devices
Short answer: Terraform and OpenTofu manage on-prem and homelab
infrastructure the same way they manage a cloud: through a provider that
talks to the platform's API. Use bpg/proxmox for Proxmox VE,
hashicorp/vsphere for VMware vSphere and ESXi, taliesins/hyperv for
Hyper-V (over WinRM), nutanix/nutanix for Nutanix AHV (through Prism
Central) and terra-farm/xenorchestra for XCP-ng. Cisco, Juniper and Arista
devices have vendor providers, and community providers cover MikroTik
RouterOS and TrueNAS Scale. Synology DSM and Unraid have no official
provider, so Terraform manages what sits around them: DNS, tunnels and
backup buckets.
This hub collects the on-prem, homelab and network-device guides on Terraform Pilot, grouped by layer. Each guide has working HCL for its provider.
Which provider for which platform
#| Platform | Provider in the guide | Guide |
|---|---|---|
| Proxmox VE (VMs and LXC) | bpg/proxmox (community) | Proxmox VE VMs and containers |
| Microsoft Hyper-V | taliesins/hyperv (community, WinRM) | Hyper-V provider and VMs |
| VMware vSphere / ESXi | hashicorp/vsphere (official) | vSphere provider setup |
| Nutanix AHV | nutanix/nutanix (official) | Nutanix AHV VMs |
| Xen / XCP-ng | terra-farm/xenorchestra | Xen and XCP-ng |
| TrueNAS Scale | dariusbakunas/truenas (community) | TrueNAS Scale and ZFS |
| Synology DSM | No official provider; Mastercard/restapi for the DSM API | Synology DSM |
| Unraid | No provider; manage Cloudflare and Backblaze B2 around it | Unraid homelab |
| Talos Linux | siderolabs/talos | Talos Linux Kubernetes nodes |
| Cisco IOS XE | CiscoDevNet/iosxe (official) | Cisco IOS XE |
| Cisco NX-OS | CiscoDevNet/nxos | Cisco NX-OS data center |
| Juniper Junos | Juniper/junos | Juniper Junos |
| Arista EOS | aristanetworks/cloudvision | Arista EOS and CloudVision |
| MikroTik RouterOS | terraform-routeros/routeros (community) | MikroTik RouterOS |
| SONiC | No single official provider; templated config_db.json or gNMI | SONiC |
Hypervisors and private cloud
#- Terraform Hyper-V: provider and VM provisioning:
the
taliesins/hypervprovider over WinRM, virtual switches and Windows Server VMs. - Terraform vSphere provider setup: connect to vCenter, clone VMs from templates with cloud-init, distributed port groups, resource pools and folders.
- Terraform for Proxmox VE:
API tokens, cloud-init VMs from a template and LXC containers with
proxmox_virtual_environment_container. - Terraform for Nutanix AHV: VMs with cloud-init and categories through Prism Central.
- Terraform for Xen and XCP-ng: VMs from templates through Xen Orchestra.
- vSphere provider v2.17.1 release notes:
product_keyis now marked sensitive.
Homelab storage and NAS
#- Unraid and Terraform: Unraid has no provider, so Terraform manages a Cloudflare Tunnel and a Backblaze B2 backup bucket around it.
- TrueNAS Scale and ZFS: datasets,
NFS shares and snapshot tasks with the
dariusbakunas/truenasprovider. - Synology DSM: what actually works:
S3 backup buckets from Terraform and the DSM API through the
restapiprovider.
Network devices
#- Network automation with Cisco, Junos and Arista: a provider cheat sheet, one example per vendor and drift detection.
- SONiC: render
config_db.jsonfrom Terraform templates and push it, or use a gNMI provider. - Arista EOS and CloudVision: Studio inputs, workspaces and change control.
- Cisco NX-OS data center switches: VLAN to VXLAN VNI mapping, BGP EVPN and vPC.
- Cisco IOS XE: VLANs, access ports and OSPF over RESTCONF.
- Juniper Junos: VLANs,
interfaces, EVPN VRFs and
commit confirmed. - MikroTik RouterOS: firewall rules, BGP peers and a DHCP server on a bridge.
Operating systems on your own hardware
#- Talos Linux Kubernetes nodes: generate machine configs and bootstrap a cluster on AWS, vSphere or Proxmox.
- NetBSD VMs: Proxmox VMs from an ISO, or
KVM through the
dmacvicar/libvirtprovider. - OpenBSD VMs: Vultr or Proxmox, with pf
configured through
remote-exec. - SmartOS and illumos zones:
the
joyent/tritonprovider, orremote-execon bare SmartOS. - Install Terraform on Raspberry Pi OS: run Terraform on a Raspberry Pi.
Running these guides with OpenTofu
#The HCL in these guides is ordinary provider configuration, so OpenTofu runs
it unchanged as long as the provider is published in the OpenTofu registry.
Replace terraform with tofu in the commands.
- Migrate from Terraform to OpenTofu: install, verify state compatibility and update CI.
- OpenTofu provider registry: provider resolution, plus filesystem mirrors and plugin caches for air-gapped sites.
- OpenTofu state encryption: encrypt state with a PBKDF2 passphrase when no cloud KMS is available.
- All OpenTofu guides
Provision, then configure
#Terraform creates the VMs and network objects; a configuration tool then sets up what runs inside them.