Skip to main content
Database

Hardened PostgreSQL Deployment on Proxmox LXC Containers

A guide to configuring lightweight PostgreSQL 16 database clusters in Proxmox LXC containers with ZFS volume datasets and automated WAL archiving.

Published ·Updated ·1 min read·Lead Network Engineer
Hardened PostgreSQL Deployment on Proxmox LXC Containers

LXC Provisioning Commands

On the Proxmox host shell, create a unprivileged Debian 12 LXC container:

bash
pct create 103 local:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst \
  --ostype debian \
  --hostname pg-db-01 \
  --cores 4 \
  --memory 4096 \
  --swap 512 \
  --features nesting=1 \
  --unprivileged 1 \
  --net0 name=eth0,bridge=vmbr0,tag=30,ip=10.0.30.50/24,gw=10.0.30.1

PostgreSQL Performance Tuning

Edit /etc/postgresql/16/main/postgresql.conf:

ini
max_connections = 100
shared_buffers = 1GB
effective_cache_size = 3GB
maintenance_work_mem = 256MB
checkpoint_completion_target = 0.9
wal_buffers = 16MB
default_statistics_target = 100
random_page_cost = 1.1
effective_io_concurrency = 200
work_mem = 10485kB
min_wal_size = 1GB
max_wal_size = 4GB

Lead Network Engineer

Network Engineer & IT Infrastructure Specialist

Networking • Infrastructure • Monitoring Specialized in high-availability enterprise networks, virtualized infrastructure, and automated Prometheus/Grafana monitoring stacks.

Keep Reading