Skip to content

Concepts ​

A handful of small ideas show up across every vibepg command. Understanding them up front makes the rest of the docs trivial to skim.

Instance ​

An instance is a single Postgres database managed by vibepg. Each instance has:

  • A user-chosen name (e.g. demo, analytics, scratch)
  • A container named vibepg-pg-<name>
  • A host port mapping to Postgres' 5432 inside the container
  • A database and user (default to the instance name)
  • A password stored in your OS keychain
  • A persistence mode: persistent (default, backed by a Docker volume) or ephemeral

Registry ​

vibepg keeps lightweight metadata about each instance in a JSON file:

PlatformPath
macOS / Linux~/.config/vibepg/instances.json
Windows%APPDATA%\vibepg\instances.json

The exact location follows the directories crate's config_dir() rules. Passwords are never stored here — they live in the OS keychain.

vibepg doctor prints the resolved path on your machine.

Naming rules ​

  • Instance names: lowercase letters, digits, -, _
  • --db, --user, --schema, --columns, <table>: PostgreSQL identifier-safe names — letters, digits, _, must start with a letter or _

vibepg validates these client-side before talking to Docker or Postgres, so you'll see clear errors instead of cryptic SQL syntax failures.

Default Postgres version ​

vibepg new pulls postgres:16 from Docker Hub by default. Override per-instance with --version:

bash
vibepg new pg15 --version 15
vibepg new pg17 --version 17
vibepg new alpine --version 16-alpine

Any tag from the official postgres image is fair game.

Port allocation ​

If you don't pass --port, vibepg picks the first free TCP port on 127.0.0.1 for you. To pin a port (e.g. for a config file your app already uses):

bash
vibepg new myapp --port 5433

Inside the container, Postgres always listens on 5432. The published host port is what shows up in vibepg ls, vibepg status, and vibepg url.

State model ​

vibepg ls reports one of three states per instance:

StateMeaning
runningContainer exists and is running
stoppedContainer exists but is stopped — vibepg up <name> to start it
missingRegistry has the instance but the container is gone (e.g. removed manually with docker rm). Recover with vibepg rm <name> to clean up the registry entry

Where things live (TL;DR) ​

ThingLocation
Instance metadata~/.config/vibepg/instances.json (or platform equivalent)
PasswordsOS keychain, key id vibepg/<name>/postgres_password
Persistent dataDocker volume vibepg-pg-<name>-data
Containervibepg-pg-<name>
LogsDocker's log driver (vibepg logs <name>)

Next steps ​

Released under the MIT License.