Quick Start: PostgreSQL
dbdeployer supports PostgreSQL sandboxes using the same workflow as MySQL. Because there is no official PostgreSQL tarball distribution, you extract binaries from .deb packages.
Prerequisites
Section titled “Prerequisites”- dbdeployer installed (Installation guide)
dpkg-debavailable (standard on Debian/Ubuntu)apt-getoraptfor downloading packages (no root needed forapt-get download)
1. Download PostgreSQL packages
Section titled “1. Download PostgreSQL packages”apt-get download postgresql-16 postgresql-client-16This downloads two .deb files into your current directory — no installation occurs.
2. Unpack into dbdeployer’s binary directory
Section titled “2. Unpack into dbdeployer’s binary directory”dbdeployer unpack --provider=postgresql \ postgresql-16_*.deb \ postgresql-client-16_*.debExpected output:
Unpacking postgresql-16 into $HOME/opt/postgresql/16.133. Deploy a PostgreSQL sandbox
Section titled “3. Deploy a PostgreSQL sandbox”dbdeployer deploy postgresql 16.13Or equivalently:
dbdeployer deploy single 16.13 --provider=postgresqlExpected output:
Database installed in $HOME/sandboxes/pg_sandbox_166134. Connect with psql
Section titled “4. Connect with psql”~/sandboxes/pg_sandbox_16613/useYou are now in the psql shell:
SELECT version();\l\q5. Clean up
Section titled “5. Clean up”dbdeployer delete pg_sandbox_16613Why not just apt-get install?
Section titled “Why not just apt-get install?”You might wonder why we download debs instead of installing PostgreSQL normally. Three reasons:
- No root needed —
apt-get downloadworks without sudo - No conflict with existing PostgreSQL — if you already have PostgreSQL running, installing another version could disrupt it
- Multiple versions — you can have 14, 15, 16, and 17 side by side in
~/opt/postgresql/
What’s next?
Section titled “What’s next?”- PostgreSQL provider details — replication, options, limitations
- Managing sandboxes — start, stop, status