Skip to main content

Connecting to your database

pocketPG supports three connection methods. All connections are read-only by default.

Direct connection string

Paste a standard PostgreSQL URL:

postgres://user:password@host:5432/dbname

pocketPG tests the connection before proceeding. If pg_stat_statements is installed, the Queries tab and several tuning recommendations become available.

SSH tunnel

For databases behind a firewall, configure an SSH tunnel:

FieldDescription
SSH HostBastion/jump host address
SSH PortDefault 22
SSH UserSSH username
SSH Private KeyPEM-format private key (stored server-side for saved instances)

SSH tunnel connections are handled separately from direct connections so saved instances can reconnect without exposing raw SSH material to shared members.

Saved instances

When you save an instance, credentials are stored server-side in the app database. This enables:

  • Server-side history sync — recent performance samples can be persisted for saved instances.
  • Shared access — invite team members without sharing raw credentials.
  • Webhook alerts — background health checks run against saved instances.
  • Daily digest — email summaries of critical findings.

Members of a shared instance never receive the raw connection string or SSH key.

Connection details

Every connection is configured with safety defaults:

  • Autocommit — avoids leaving monitoring queries inside open transactions.
  • Statement timeout — caps monitoring query duration so one slow diagnostic query does not stall the app.
  • Lightweight pooling — reuses safe direct connections to reduce repeated TCP/TLS/auth overhead.