Almost every "run PostgreSQL locally" tutorial starts with docker run postgres. That gives you two dependencies, a daemon and, on a Mac or Windows box, a whole Linux VM, all so a test suite can make a few tables and drop them again.

Jeff Lindsay (progrium) shipped another way to run Postgres without Docker last week. miniPG is one executable that embeds the real Postgres 18 server and client, and you use it the way you use sqlite3: point it at a path and that path is the database. There's no daemon or container to babysit, and nothing to docker compose down when you're finished.

I think it's the most interesting local-Postgres tool in a while. I also think the launch pitch gets ahead of the code in two places: the 800ms startup number, and pgvector. I'll go through the commands first and get to the fine print after.

What miniPG actually is

From the launch post: "a single program that embeds a full Postgres server and client." It's "actually real Postgres, not a compatibility layer." According to the manual, v0.3 embeds Docker Hub's postgres:18-alpine image, and init --pg 17 will fetch another major version if you need one. The project is MIT licensed.

When nothing is using the database, it's "just files on disk. You can copy it, back it up, or delete it." For tests, that's most of the appeal.

How to run Postgres without Docker using miniPG

Install by downloading the zip for your platform from the releases page, unzipping it, and putting minipg (or minipg.exe) on your PATH. There's no Homebrew formula or install script yet.

Two platform gotchas from the README:

# macOS, if the binary got quarantined by your browser xattr -d com.apple.quarantine ./minipg # Windows needs the Hypervisor Platform feature (admin shell, then reboot) DISM /Online /Enable-Feature /FeatureName:HypervisorPlatform 

Use it like sqlite3

These examples come straight from the launch post:

minipg ./mydb "create table notes (id serial, body text)" minipg ./mydb "insert into notes (body) values ('hello')" minipg ./mydb "select * from notes" 

A bare path is shorthand for minipg shell. Run it without SQL and you get psql.

Expose a normal server on 5432

For anything that wants a host and port:

minipg serve ./mydb -p 5432 

serve also takes --listen, --log, --idle SECONDS and --trust. It binds to 127.0.0.1 by default and uses SCRAM-SHA-256 even on loopback. --trust turns the password off for loopback clients, which is what you want for a local tool and nothing else.

Run one command against the database, then nothing is left running

This is the part I like most:

minipg run ./mydb -- some-tool 

The manual says run starts your command with DATABASE_URL, PGHOST, PGPORT, PGUSER, PGPASSWORD and PGDATABASE set. Once the command exits, "there's no database daemon to leave around or remember to stop." So any self-hosted app or migration tool that reads its Postgres config from the environment runs without changes, and your test runner can go in the -- slot the same way.

If you'd rather keep a server up in your shell, eval "$(minipg env app.pgdb)" exports the same variables (minipg env app.pgdb | Invoke-Expression in PowerShell).

Using it for tests and AI agents

The launch post pitches "a throwaway database per test, or a local copy of the same database you run in production, without Docker," and agents that "spin up a real Postgres for a task and throw it away when they're done."

A caveat that changes how you set this up: minipg init takes about 4 seconds according to the manual, and it refuses to run if the path already exists. Running init once per test will add up. Two cheaper patterns, both using documented commands:

  1. One .pgdb for the whole suite, with a database per test file via minipg create app.pgdb test_users and minipg drop app.pgdb test_users.
  2. init and migrate a template once, then copy the directory for each run while nothing has it open. The author points out it's just files.

For agents, a database that is a folder is easy to reason about. The agent can get its own copy, break it however it wants, and rm -rf it afterwards, and nothing touches your real dev database.

Why not PGlite? One connection deadlocked a real app

PGlite was the obvious first try: Postgres compiled to WebAssembly, "under 3mb Gzipped" according to its docs. Lindsay loaded it in Go with wazero, and then ran into the documented limit: PGlite "only has a single exclusive connection to the database" (docs).

The launch post explains why that breaks real software: "A common pattern is to start a transaction, then make another query on a separate connection before committing. With only one connection, that second query waits for a transaction that's waiting on it. The app I was trying to run deadlocked."

PGlite does have pglite-socket, which multiplexes several clients over that one connection, but its own docs say "not all use cases are guaranteed to work." If you control every query, PGlite is fine. If you're running someone else's app, you don't control the queries, and that's the case miniPG was built for.

One commenter on Lobsters, eest, made a fair counterpoint: with ordinary Postgres, that same pattern risks a deadlock once "a sudden burst in requests goes past whatever current connection pool limit you have set," and they catch it by "limiting the pool to one connection in tests." So arguably PGlite found a real bug, though when the app belongs to someone else it isn't your bug to fix.

How startup went from 7 seconds to 800ms

The second attempt booted a full Postgres VM in the v86 x86 emulator inside a headless webview, with connections tunnelled over a WebSocket. It ran the same build on every OS, but it was "an order of magnitude slower than native," and on an M3 MacBook it took 7 seconds before it would accept a connection. A sqlite3-style CLI where every select waits 7 seconds isn't usable, so it got shelved.

The current version runs on Hyper9, which borrows the system-API-translation idea behind Wine and Valve's Proton and combines it with "a unique way to use hypervisors." On Windows that means WHP; the Linux benchmarks in the manual use a "native backend" with no KVM at all. Per the launch post, the result: "Startup went from 7 seconds to 800ms." The manual's numbers are less generous, as you'll see below.

The fine print the launch post skips

These numbers are from the project's own manual and README, measured on x86_64 Linux with the native backend:

miniPG v0.3
Speed, one client (native backend) about 2x slower than native
Speed, under load 6 to 12x slower
Server start about 2 s (first start about 4 to 8 s)
New connection about 27 ms
Memory about 375 MB idle, about 550 MB under load
Windows WHP reserves 2 GB per server up front
Extensions what ships in the alpine image (pgcrypto, hstore, pg_trgm)
Tested Linux x86_64 and Windows x86_64; macOS Apple Silicon and Linux arm64 listed as "builds; not run"
Not supported Intel Macs, Windows on ARM

Start with the startup row. The 800ms in the launch post is the best case (the v0.3 release notes say "Best case server boot"), while the manual's own table puts a server start at about 2 seconds. Still far better than 7, and fine for a test suite, but don't expect every one-shot minipg ./mydb "select 1" to come back in under a second.

The extensions row is the bigger gap. The launch post lists "extensions like pgvector or PostGIS" among the Postgres features SQLite-style apps want, but the manual says third-party extensions "aren't [available], until custom images arrive." pgvector and PostGIS are both third-party, so if that's why you came, wait for the init --image roadmap item.

Also notice that macOS row. Many readers of this post will be on Apple Silicon, and the README doesn't yet claim anyone has run it there (v0.3 did ship a signed and notarized macOS build). The project page itself says: "Don't trust it with data you can't recreate yet." That's acceptable for test fixtures and a hard no for anything else.

Where you should still use real Postgres

The author draws the line in the launch post: "If you're running in the cloud, using replicas, or serving many users over many connections, use Postgres the normal way." I'd add CI that already has Docker. If your GitHub Actions job has a services: postgres block that works, a 2x-slower single-client engine gives you nothing there.

My take: today miniPG is a better default than Docker if you're running a self-hosted tool that requires Postgres, doing local dev on Linux or Windows, or letting agents create and delete databases without a daemon in the way. Testcontainers still wins when you need exact production parity or pgvector, and PGlite still wins in the browser.

What do you use for throwaway Postgres in tests right now: Docker, Testcontainers, PGlite, or a shared dev database everyone is afraid to reset? Would one binary replace it, or is that 2x slowdown a dealbreaker?

Sources