Skip to content

Getting Started ​

Install ​

npm package

The npm package needs a fix and will be available again on 10 November 2026. Until then, install the .NET tool below, or use dnx for the MCP server.

With npm (Node.js 18 or newer):

bash
npm install --global pgembed
snippet source | anchor
bash
npx pgembed versions                  # or run it without installing
snippet source | anchor

Or as a .NET tool (the .NET 10 SDK or newer):

bash
dotnet tool install --global pgembed
snippet source | anchor
bash
dnx pgembed versions                  # or run it without installing
snippet source | anchor

Both install the same native executable, compiled ahead of time, so commands start in a few milliseconds. There is one for each platform: Windows x64, Linux x64 and arm64 with glibc or musl, macOS x64 and arm64. On other platforms, the .NET tool installs a portable build; npm has none.

Your first instance ​

bash
pgembed start app --version 17          # downloads Postgres 17 once, starts it in the background
pgembed sql app "SELECT version()"
pgembed stop app
snippet source | anchor

start prints the connection string:

txt
● Started app: PostgreSQL 17.11.0 on port 5432
  Host=localhost;Port=5432;Username=postgres;Database=postgres

The first start of a version downloads it (about 14 MB on Linux, 24 MB on Windows, 30 to 70 MB on macOS) with a progress bar; later starts take about a second, and starting an instance that already runs attaches to it instantly.

Next ​

  • Instances: several versions, ports, settings, connection strings, logs.
  • SQL: scripts, output formats, the interactive prompt, confirmation of changes.
  • From .NET tests and apps: use instances from xUnit and from your app.
  • MCP: give your AI assistant a Postgres.

Released under the MIT License.