
Proxmox GitOps: 5 Ways to Automate Your Cluster
Proxmox GitOps works best when Git records the intended state, automation applies predictable changes, and humans still control risky operations. In Proxmox VE 9.2, a practical GitOps stack can use Terraform or OpenTofu for infrastructure, Ansible for configuration and CI pipelines for review and execution.
The important part is scope. GitOps is a way to operate infrastructure from a versioned desired state, with changes reviewed and applied through automation. It should make recovery and change control easier. If it turns a simple cluster into five layers of YAML nobody understands, the design failed.
This guide is based on Proxmox VE 9.2 documentation and current automation projects as of August 15, 2026. I am deliberately separating documented capabilities from things a pipeline technically could do but probably should not do unattended.
What does GitOps mean for Proxmox?
GitOps means that the configuration you intend to run is stored in Git and changes move through a controlled workflow before automation applies them. The repository becomes an auditable record of what should exist and why it changed.
That does not mean every Proxmox setting must be reconciled every minute. A homelab can use a lightweight Git workflow. A production platform can add pull requests, validation, approvals and environment promotion.
The useful question is not "Can this be automated?" It is "Would automatic reconciliation make this safer?"
Before adding a GitOps layer, build a predictable base with the Proxmox installation guide and a tested Proxmox backup strategy.
1. How can GitOps provision Proxmox VMs and LXCs?
The first useful GitOps pattern is declarative provisioning of virtual machines and containers. Terraform or OpenTofu can describe the VM name, CPU, memory, disks, network interfaces, tags and initialization settings in code.
The BPG Proxmox provider exposes resources for Proxmox VE VMs and LXC containers. Its Cloud Init guide shows how initialization data can be attached to a VM at creation time.
That gives you a clean workflow:
- An engineer changes the infrastructure definition.
- A pull request shows exactly what changed.
- Validation runs before anything touches the cluster.
- An approved pipeline applies the change.
- Git records the desired configuration and review history.
This pattern is especially useful for development environments, branch environments, lab clusters and standardized server roles.
The main danger is configuration drift. If people continue to resize Terraform managed VMs manually in the Proxmox GUI, the next plan may try to reverse those changes. Define ownership clearly. Either a field is controlled by code or it is controlled manually.
2. How should Ansible fit into Proxmox GitOps?
Ansible fits naturally after provisioning because it can configure both Proxmox infrastructure and the operating systems running inside it. The current community.proxmox collection contains modules for instances, KVM VMs, clusters, ACLs, pools and SDN objects.
I prefer to keep responsibilities simple. Terraform creates infrastructure. Ansible configures systems. Git and CI control when each layer runs.
For example, a pull request might add a new monitoring VM. Terraform creates it from a standard template. Cloud Init gives it network identity and an SSH key. Ansible installs the monitoring software, applies configuration and registers it with the rest of the environment.
That sequence is easier to troubleshoot than one giant tool trying to manage every layer.
Ansible can also create and join Proxmox clusters through the community.proxmox.proxmox_cluster module. I would still put cluster membership changes behind explicit approval. Corosync and quorum are not good places for casual continuous reconciliation.
3. Can GitOps manage LXC application platforms?
Yes, and this is where projects such as Proxmox-GitOps become interesting. The project describes a self contained GitOps environment for provisioning and orchestrating Linux Containers on Proxmox VE and lists Proxmox VE 8.4 through 9.2 in its requirements.
Its model treats a monorepository as the desired state and uses a multistage pipeline to bootstrap and deploy container infrastructure. It also uses Ansible as part of container provisioning.
That is more than a collection of scripts. It is an operating model.
The benefit is reproducibility. A container should be replaceable from code instead of repaired by hand for years.
The cost is abstraction. When the pipeline fails, you need to understand Git, CI, Proxmox authentication, LXC behavior, networking and the configuration tool beneath it. If only one person understands the stack, you have automated the bus factor.
For simpler app deployment, the Proxmox Helper Scripts guide may be more appropriate. GitOps earns its complexity when repeatability and change control matter more than setup speed.
4. Should updates be driven from Git?
Git is a good place to declare update policy, but unattended updates across an entire Proxmox cluster need guardrails. Version changes can affect the kernel, QEMU, storage behavior, drivers and cluster services.
A safer pattern is to store the policy and workflow in Git while keeping execution staged.
For example, define which repository a node uses, which maintenance group it belongs to, what prechecks must pass and whether workloads must be migrated before a reboot. The pipeline can prepare the change, run checks and stop for approval before touching production.
Proxmox VE 9.2 adds HA arm and disarm controls for planned maintenance. That is useful operationally, but it does not remove the need to understand what the update changes.
I would also avoid making "latest" the desired state without qualification. Infrastructure automation should target a reviewed package set or approved release window, not chase change simply because a repository published it.
5. How can GitOps improve disaster recovery?
GitOps is most valuable during recovery when the repository contains enough information to rebuild infrastructure without relying on someone remembering every setting. VM definitions, network intent, role assignments, guest configuration and deployment scripts can all reduce recovery time.
But Git is not a VM backup.
A repository will not restore a database disk, a Windows system volume or an LXC dataset. Keep workload backups separate and test them. The Proxmox backup guide covers the recovery side that infrastructure code cannot replace.
I like to think of recovery in two layers. Git rebuilds the skeleton. Backups restore the stateful data.
This also exposes a useful test. If your Proxmox host disappears, can a new administrator read the repository and understand how to reconstruct the environment? If the answer is no, your code may be automated but your recovery process is not documented.
What should Proxmox GitOps never automate blindly?
Do not start by continuously reconciling storage destruction, Ceph topology, quorum membership, HA fencing behavior, firewall policy and privileged credentials. Those areas have a large blast radius.
Put destructive actions behind review. Use separate credentials for read, plan and apply where your tooling allows it. Protect secrets outside the repository. Test changes against a nonproduction environment.
Also remember that API access is power. Community tooling can be excellent, but every token should have the minimum permissions required for its job.
What Proxmox GitOps stack would I build?
I would keep it small. Git hosts the desired state and review history. Terraform or OpenTofu provisions VMs and LXCs. Ansible handles configuration. A CI runner performs validation and approved applies. Proxmox Backup Server or another tested backup platform protects stateful workloads.
I would not begin with automatic reconciliation of every cluster object. First automate the boring, repeatable work. Provision a test VM. Rebuild it from scratch. Add configuration. Prove that a second person can understand the pipeline.
When that works, expand the scope.
A small team with ten stable VMs may not need GitOps at all. The Proxmox GUI, documented procedures and backups can be a better system than an automation platform nobody maintains. GitOps becomes valuable when change frequency, scale or recovery requirements justify the extra machinery.
Frequently Asked Questions
Can you use GitOps with Proxmox VE 9.2?
Yes. Proxmox VE exposes APIs that tools such as Terraform, OpenTofu and Ansible can use, and community projects such as Proxmox-GitOps target Proxmox VE 8.4 through 9.2.
What should GitOps manage in Proxmox?
Start with repeatable VM or LXC definitions, guest configuration and policy. Keep destructive storage changes, quorum changes and emergency recovery behind explicit review until the workflow is proven.
Is GitOps the same as Terraform for Proxmox?
No. Terraform or OpenTofu can be one execution layer inside a GitOps workflow. GitOps adds a versioned desired state, review process and automated reconciliation around the infrastructure code.