Skip to content
v0.1.6Tables, columns and indexes, right in the UI

The Postgres admin that starts with one command.

Browse and edit rows, run SQL, change tables and watch live activity on every database on your server. pgdeck runs wherever Node does and opens in any browser.

npx pgdeck postgres://user:pass@host:5432/db
Read the docs

Free and open source, MIT licensed. Needs Node.js 20 or newer.

The pgdeck overview: connections, transactions and cache stats, live charts of transactions and rows per second, and the active sessions on the shop database.The pgdeck overview: connections, transactions and cache stats, live charts of transactions and rows per second, and the active sessions on the shop database.
1M rows
imported from CSV in about 3 s
1 command
no install, no config, no account
7 formats
to export, plus SQL backups
PostgreSQL 12+
local, in Docker or managed

From connection string to browser in one step.

No agent to install on the server, no desktop app, no account. pgdeck connects like any other Postgres client.

  1. 1

    Point it at Postgres

    Pass a connection string, or let pgdeck read DATABASE_URL and the usual PG* variables.

  2. 2

    pgdeck starts a server

    One Node process on one port. It prints the address and a fresh login password.

  3. 3

    Open it from anywhere

    On the same machine, through an SSH tunnel, or behind nginx or Caddy with HTTPS.

Built for the work you actually do in a database.

Not a stripped-down viewer. Editing, schema changes, imports, backups and monitoring, in one tab.

Live overview

Transactions and rows per second streamed every two seconds, with sessions, storage and health checks.

Transactions / s
154
CommitsRollbacks
Live

Every database, one ⌘K away

Switch without restarting. Create, copy, rename and drop databases.

Editors that know the type

Menus for enums, a calendar for timestamps, checked JSON, UUIDs in the version you already use.

Filters that combine

Equals, contains, in, like, is null and more, joined with AND or OR. No SQL needed.

Imports in gigabytes

CSV, TSV or JSON Lines, gzipped or not, streamed through COPY. A bad row rolls back and names the line.

Schema changes you read before they run

Create tables, add and retype columns, and build indexes concurrently. Every dialog shows the exact SQL it will run.

SQL previewCreate table
  1. 1CREATE TABLE "public"."invoices" (
  2. 2 "id" bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  3. 3 "customer_id" uuid NOT NULL,
  4. 4 "total" numeric(12,2),
  5. 5 "created_at" timestamptz DEFAULT now() NOT NULL,
  6. 6 FOREIGN KEY ("customer_id") REFERENCES "public"."customers" ("id")
  7. 7);
  8. 8
  9. 9CREATE INDEX CONCURRENTLY ON "public"."invoices"
  10. 10 ("created_at" DESC);

Foreign keys you can follow

Preview the referenced row from any cell, jump to it, or see every table pointing back.

Values stay exact

Everything travels as Postgres text: timestamps keep their zone, numeric and bigint never lose a digit.

Table actions

Rename, duplicate, truncate, vacuum, analyze, refresh, drop, or copy the CREATE statement.

Backups that restore

Consistent pg_dump-style backups out; plain, gzipped or custom-format dumps back in.

Health checks that act

Never-analyzed tables, dead rows, missing indexes, with a button that fixes them.

Read-only when it matters

Start with --readonly and every session is read-only and editing disappears.

Works behind any proxy

Relative URLs, an optional base path, and WebSockets that pass through nginx or Caddy.

Fast from the keyboard

⌘K to switch databases, ⌘Enter to run SQL or save a row, Esc to close.

Light and dark

Follows your system, or pick one. Charts and code are tuned for both.

Take the tour.

Real screens from pgdeck, running against a demo shop database.

The orders table: order ids, customer UUIDs linking to customers, statuses, totals and timestamps, with filters and pagination.The orders table: order ids, customer UUIDs linking to customers, statuses, totals and timestamps, with filters and pagination.
The Edit row dialog for an order, with a foreign key Browse button, a status menu and date pickers.The Edit row dialog for an order, with a foreign key Browse button, a status menu and date pickers.
The SQL editor with a revenue-by-country query and its result rows.The SQL editor with a revenue-by-country query and its result rows.
The Structure tab for orders with columns, indexes and constraints.The Structure tab for orders with columns, indexes and constraints.
The New table dialog with columns, constraint toggles and a references picker.The New table dialog with columns, constraint toggles and a references picker.
The Import page with drop zones for data files and backups.The Import page with drop zones for data files and backups.
The Export page with a table list and format options.The Export page with a table list and format options.

Sort, page and filter millions of rows. Headers show each type and where its foreign key points.

Run it next to your database.

On your laptop for local work. On a server behind an SSH tunnel or a reverse proxy with HTTPS for everything else. It works at the root of a domain or under a path.

--readonly
Read-only sessions, no editing
--password
A fixed login instead of a random one
--host 0.0.0.0
Listen beyond localhost
--base-path /db
Serve under a path prefix
--ssl
SSL without certificate checks
# Local database, opens your browser
npx pgdeck postgres://postgres@localhost:5432 --open

# Production, read-only, with a fixed password
PGDECK_PASSWORD='correct horse battery staple' \
  npx pgdeck "$DATABASE_URL" --readonly

# Managed Postgres that requires SSL
npx pgdeck "postgres://user:pass@db.example.com/app?sslmode=require"

Login by default

A random password at every start, HTTP-only SameSite=Strict cookies, and rate-limited sign-in.

Private unless you say so

Binds to 127.0.0.1. It warns if you expose it without a login.

Cross-site safe

API calls need a custom header and WebSockets check their Origin.

Least privilege

pgdeck can only do what its role can. Use a read-only role for anything sensitive.

Point it at a database and press Enter.

It prints a link and a password. Open the link. That’s the setup.

npx pgdeck postgres://localhost:5432
Star on GitHub