Urgent.News

What's breaking now, across hundreds of outlets.

Tech

How to Run PostgreSQL Without Docker: miniPG Works Like sqlite3 (No pgvector)

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,…

Last week, Jeff Lindsay (progrium) introduced miniPG, a single executable that embeds the real Postgres 18 server and client. Unlike other "run PostgreSQL locally" tutorials that involve Docker or a Linux VM, miniPG requires no daemon, container, or additional setup. It works just like sqlite3, where you point it at a path and that path becomes your database.

miniPG offers several advantages. First, it eliminates the need for additional dependencies, making it faster and easier to set up. Second, since it's just files on disk, you can easily back it up, copy it, or delete it when you're done. This simplicity makes it an intriguing local-Postgres tool.

To run miniPG, download the zip file for your platform from the releases page, unzip it, and place minipg (or minipg.exe) on your PATH. On macOS, you may need to remove quarantine attributes using xattr, and on Windows, you'll need to enable the Hypervisor Platform feature. Once installed, you can use miniPG in a similar manner to sqlite3. For example, you can create a table, insert data, and select data using commands like:

minipg ./mydb "create table notes (id serial, body text)"

minipg ./mydb "insert into notes (body) values ('hello')"

minipg ./mydb "select * from notes"

For those who want a normal server running on port 5432, miniPG provides a serve command:

minipg serve ./mydb -p 5432

This command exposes a server on the specified port and uses SCRAM-SHA-256 for authentication, even on loopback connections. The trust option disables passwords for loopback clients, which is ideal for a local tool.

One of the most appealing features of miniPG is its ability to run a command against the database and then exit cleanly, leaving no traces behind. This is particularly useful for self-hosted apps or migration tools that rely on environment variables for configuration. By using minipg run ./mydb -- some-tool, you can execute commands without any additional setup, and the database will be clean up when the command exits.

For testing and AI agents, miniPG offers a straightforward solution. You can create a database per test or use a single .pgdb for the entire suite, with separate databases for each test file. This approach eliminates the need for a full Docker setup and allows you to reason about the database as just files on disk. If you prefer to keep a server running in your shell, you can use the eval "$(minipg env app.pgdb)" command in Bash or Invoke-Expression in PowerShell to set the necessary environment variables.

MiniPG's simplicity and ease of use make it an attractive choice for developers and testers who want a quick, local PostgreSQL environment without the overhead of Docker or other virtualization tools. Although PGlite offers a similar solution, miniPG's design and performance make it a more practical choice for real-world applications.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Upload2Shell: check your Ghostscript version and stop trusting safe image pipelines

Upload2Shell, tracked as CVE-2026-125396, is a use-after-free in the Type 1 font loader of Ghostscript. A crafted document can escape the dSAFER sandbox.

  • CVE-2026-125396 is a use-after-free vulnerability in Ghostscript's Type 1 font loader
  • Exploited in Debian 13 CUPS, Roundcube 1.7.2, MediaWiki, and WordPress 7.0.0 to 7.0.3
  • Patched in Ghostscript version 10.08.0 on September 8th, 2026

Why a disk cleaner should never delete on its own

A disk cleaner has an unusual job: its main feature is destroying data. The failure modes aren't "a button is in the wrong place" — they're "my thesis is gone".

  • Disk cleaner's primary purpose is to delete data, not free space
  • Scanner presents items for deletion, no "clean everything" button
  • Default deletion route is system Trash, easy to recover from mistakes

More from Monday 23 November →