Forgejo

Appearance

Make haypack comfortable for you.

Theme
Font
Contrast
Text size
Layout

Saved in this browser. No cookies.

PostgreSQL

PostgreSQL server from Debian, reachable on localhost only

postgresql LXCVM

Add to a guest

In the guest as root – container and VM alike:

update --add-modules postgresql

Runs 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 postgresql

Choose when creating a guest

Without a dialog, on the Proxmox node:

IAC_NONINTERACTIVE=1 var_modules=auto-update,postgresql \
  bash -c "$(curl -fsSL https://haypack.dev/<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 postgresql

Removes 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.