Skip to content

Minipg: PostgreSQL as a Single Executable

News.Ycombinator • November 26, 2026

minipg is PostgreSQL as one executable, ready to use, with no server to configure. A .pgdb directory is the database: its data, config, credentials, and Postgres version all live inside it, and minipg app.pgdb opens a psql shell on it. A server starts when a command needs one and stops on its own when it's idle.

minipg embeds Docker Hub's postgres:18-alpine image and runs it with h9 , used as a Zig library. h9's Linux personality runs Alpine's own Postgres binaries directly on the host's hypervisor, with h9's Plan 9 kernel answering their system calls. There's no Linux kernel to boot, no VM image, and no Docker.

The demo downloads 35 MB. It needs JavaScript Promise Integration, which Chrome and Edge have from version 137; other browsers are getting it. It can also be opened on its own page .

The demo runs minipg's Linux build, which runs inside the Postgres image itself. It starts Postgres as ordinary processes and serves on a unix socket, since a page has no TCP. New databases come from a template cluster made at build time, because initdb takes half a minute on v86.

A .pgdb holds minipg.toml (settings and the generated superuser password) and pgdata/ , Postgres's data directory as plain files. A stopped one can be copied like any directory. New clusters use Postgres's builtin C.UTF-8 locale, which sorts the same on every platform.

In CI, the Linux binary is static and needs no privileges or devices: without /dev/kvm , h9 runs Postgres on its native backend. A test job can be as small as:

The README lists every command, and the manual is the full guide.

Exactly one process runs Postgres for a .pgdb , enforced by a lock. It holds the server's h9 machine, whose Linux root is the unpacked image and whose writable working directory is the .pgdb . The image's docker-entrypoint.sh initializes the cluster on first start. Commands never host Postgres themselves. If no server is running, they start one in the background and use it. psql, pg_dump, and the other tools each run in their own short-lived h9 machine ( 90 ms to start) over the same root.

The source is on GitHub , under the MIT license. Building needs Zig 0.16, plus curl , jq , tar , and xz for the root:

minipg is early, and h9's Linux personality is young. On h9's native backend, Postgres is 2x slower than native for one client, and slower under load. Don't trust it with data you can't recreate yet.

Please report bugs and send questions through GitHub issues .

h9 , which runs native 9front executables, and Linux ones, on host hypervisors

PostgreSQL and Docker Hub's postgres image

v86 , the x86 emulator the demo runs on

xterm.js , the demo's terminal

Extracted Entities