Terraform with Proxmox β My Experience
When I first started using Terraform to manage Proxmox, I had to go through a few setup steps to get everything running smoothly. Hereβs my walkthrough that helped simplify automation and provisioning.
Step 1: Create an API Token in Proxmox
- Go to Datacenter β Permissions β API Tokens in the Proxmox web UI.
- Create a new API token for your user.
- Assign permissions (e.g.
PVEAdmin
orPVESysAdmin
). - Store your token securely.


Step 2: Save Your API Token in Terraform
I configured my Terraform provider using the credentials.auto.tfvars
file:


Never expose your API token publicly. Keys shown here have been rotated and are from my home lab.
Step 3: Use My Template Repo
I used my GitHub repo to simplify the VM cloning setup:
github.com/malcolmso/Proxmox-Terraform
- Clone the repo:
git clone https://github.com/malcolmso/Proxmox-Terraform.git
- Update
credentials.auto.tfvars
with your Proxmox settings - Run
terraform init
- Run
terraform plan -var-file="credentials.auto.tfvars"
- Run
terraform apply -var-file="credentials.auto.tfvars" -auto-approve
Final Thoughts
This setup helped me automate VM provisioning in Proxmox using Terraform. By leveraging API keys and a structured Terraform config, I was able to streamline workflows and eliminate manual steps. I highly recommend starting with the GitHub template and customizing it to your needs.