← Back to BLACKWIRE PRISM BUREAU DEVOPS INNOVATION Terminal window showing minipg launching a PostgreSQL shell inside a browser emulator

The minipg demo runs a PostgreSQL instance inside the v86 emulator, accessed via a web‑based terminal.

MINIPG DELIVERS POSTGRESQL AS SINGLE EXECUTABLE

*minipg collapses a full PostgreSQL stack into one portable binary. No server, no Docker, no VM—just a .pgdb directory that spins up on demand. The trade‑off: convenience versus a noticeable performance hit.*

By PRISM Bureau - BLACKWIRE  |  November 26, 2026, 10:00 CET  |  minipg, PostgreSQL, single executable, h9, containerless database

Jeff Lindsay’s minipg redefines how developers interact with PostgreSQL. The tool bundles the official Docker Hub postgres:18‑alpine image and runs it through the h9 library, which presents a Plan 9 kernel to the Linux binaries. The result is a single executable that creates a .pgdb directory holding data, config, credentials, and the exact Postgres version. When a command needs a server, minipg launches one in the background and shuts it down the moment it goes idle. No separate daemon, no Docker daemon, no hypervisor boot‑up—just an on‑demand database that can be copied like any folder.

How does minipg package PostgreSQL?

minipg embeds Docker Hub’s postgres:18‑alpine image and runs it with h9, a Zig library that supplies a Plan 9 kernel to answer Linux system calls. The .pgdb directory becomes the entire database: a minipg.toml file with settings and a generated superuser password, plus a pgdata subdirectory that mirrors PostgreSQL’s native data layout. On first launch, the image’s docker‑entrypoint.sh initializes the cluster; subsequent commands reuse the same lock‑enforced process. Each client tool—psql, pg_dump, etc.—spins up a short‑lived h9 machine (≈90 ms) that shares the same root, ensuring isolation without a full VM.

Can minipg run inside a web browser?

The demo, a 35 MB download, runs minipg’s Linux build inside the Postgres image itself via the v86 x86 emulator. It requires browsers that support JavaScript Promise Integration, available in Chrome and Edge from version 137; other browsers are catching up. Because a page cannot open TCP sockets, the demo serves PostgreSQL on a Unix socket. New databases are created from a template cluster baked at build time, sidestepping the half‑minute initdb delay on v86. The demo can also be opened on its own page, showing a terminal that launches psql directly.

minipg turns PostgreSQL into a single, portable binary—no server, no Docker, just a .pgdb directory.

What are the performance and reliability caveats?

On h9’s native backend, minipg runs PostgreSQL about twice as slow as a native installation for a single client, and the gap widens under load. The author warns against trusting the tool with data that cannot be recreated. The early‑stage nature of h9’s Linux personality means bugs are expected. Users are urged to report issues on GitHub and to avoid production workloads until the performance gap narrows and stability improves.

How to build and deploy minipg?

The source lives on GitHub under an MIT license. Building requires Zig 0.16 plus curl, jq, tar, and xz for the root image. Typical steps: clone the repo with submodules, run `make build` to pull the host‑specific root, then `make` to produce the static Linux binary. For other architectures, `make root ARCH=386` fetches the appropriate root; `make web` builds the demo page into .zig‑out/web. Once built, commands like `minipg init test.pgdb` and `minipg run test.pgdb -- go test ./...` enable CI pipelines without privileged devices. Bugs and questions are routed through the GitHub issues tracker.

Frequently asked questions

What is a .pgdb directory in minipg?

A .pgdb directory stores minipg.toml (settings and generated superuser password) and pgdata, PostgreSQL's data directory as plain files, making the whole database portable.

Can minipg run inside a web browser?

Yes. The demo runs minipg's Linux build inside the Postgres image via the v86 emulator and requires browsers with JavaScript Promise Integration, such as Chrome and Edge version 137 or later.

Is minipg ready for production use?

No. The author warns that on h9's native backend PostgreSQL is about 2× slower than native and slower under load, and advises against using it for data that cannot be recreated.

minipg proves that a full‑featured relational database can live inside a single executable, a compelling proposition for CI and edge environments. Yet the current performance penalty and early‑stage stability mean it remains a developer curiosity rather than a production staple. As h9 matures, the gap may close, potentially reshaping how teams spin up databases on demand.

Sources: [Hacker News – Minipg: PostgreSQL as a Single Executable]