This host publishes the database provisioning script and the PostgreSQL operational files used on user2804.openweb.direct.
Use the provisioning script on the server to create one database and one admin login per client. Use the operational files here as reference and for manual maintenance.
Host: user2804.openweb.direct:5432Use this on the server to create a new client database and a database owner login with its own password.
/usr/local/bin/provision-postgresql-client.sh client_db client_admin 'StrongPasswordHere'
Identifier rule: use letters, numbers, and underscores only, and start with a letter or underscore.
Give apps one role per database. Do not use the cluster admin role in application code.
postgresql://USERNAME:PASSWORD@user2804.openweb.direct:5432/DATABASE_NAME?sslmode=verify-full
For psql and other libpq clients on Linux, add the CA bundle:
sslrootcert=/etc/ssl/certs/ca-certificates.crt
curl -O https://user2804.openweb.direct/downloads/provision-postgresql-client.sh
sudo /usr/local/bin/provision-postgresql-client.sh acme_app acme_admin 'ChangeThisPasswordNow!'
psql example.PGPASSWORD='ChangeThisPasswordNow!' psql "host=user2804.openweb.direct port=5432 dbname=acme_app user=acme_admin sslmode=verify-full sslrootcert=/etc/ssl/certs/ca-certificates.crt"
Runs a full logical backup using pg_dumpall, compresses it, and keeps 14 days.
sudo /usr/local/bin/postgresql-nightly-backup.sh ls -lh /var/backups/postgresql
Runs the backup script once on demand through systemd.
sudo systemctl start postgresql-nightly-backup.service sudo journalctl -u postgresql-nightly-backup.service -n 50 --no-pager
Schedules the backup job daily at 02:15 server time.
sudo systemctl status postgresql-nightly-backup.timer --no-pager sudo systemctl list-timers postgresql-nightly-backup.timer
Triggered by certbot after certificate renewal. It copies the refreshed certificate into PostgreSQL's TLS path and restarts PostgreSQL.
sudo sh /etc/letsencrypt/renewal-hooks/deploy/postgresql-cert-refresh.sh
Reference guide for remote applications, client roles, SSL mode, and connection examples.
curl -O https://user2804.openweb.direct/downloads/postgresql-remote-access.md