PostgreSQL
PostgreSQL server from Debian, reachable on localhost only
Add to a guest
In the guest as root – container and VM alike:
update --add-modules postgresqlRuns a normal update and installs the module on the way.
From the Proxmox node, without logging in:
pct exec <ID> -- update --add-modules postgresql # container
ssh root@<IP> update --add-modules postgresqlChoose when creating a guest
Without a dialog, on the Proxmox node:
IAC_NONINTERACTIVE=1 var_modules=auto-update,postgresql \
bash -c "$(curl -fsSL https://iac.heyer.systems/<app>/ct.sh)"var_modules replaces the app's preselection – keep auto-update in the list if you want it. Interactive: choose “advanced” in the dialog, or tick the module in the generator on the app page.
Remove
update --remove-modules postgresqlRemoves the module's packages, services, firewall rules and configuration again. Data stays. Apps that require the module keep it – it cannot be removed there.
Details
PostgreSQL from Debian (trixie: version 17), reachable on localhost only – meant for the app in
the same guest. Apps that need a database list the module in their iac.json and create their
database and user themselves; the password is a secret of the instance in
/etc/iac/settings.env.
runuser -u postgres -- psql # SQL console as superuser
runuser -u postgres -- psql -l # databases
pg_lsclusters # cluster, port, data directory
Data: /var/lib/postgresql/17/main. iac does not touch the configuration – own settings go
into /etc/postgresql/17/main/conf.d/*.conf, then systemctl restart postgresql.
With the module backup, every database is dumped every night before the backup
(/var/backups/iac/db/postgresql.sql).
When the module is removed, the service stops – the data stays.