Skip to main content

Databases

A database in DBHost is a PostgreSQL database with its own user, password, and PgBouncer pool slot. Each database is isolated — users can only access their own databases. Database names must be lowercase letters, numbers, and underscores (1-63 characters, starting with a letter). The name becomes both the PostgreSQL database name and the username.

PgBouncer

Every database connection goes through PgBouncer, a lightweight connection pooler. This means:
  • Lower overhead — PgBouncer multiplexes many client connections onto fewer PostgreSQL backend connections
  • Port 6432 — Always connect on port 6432, not 5432
  • Transparent — Your application connects to PgBouncer exactly like it would to PostgreSQL directly

Backups

Backups use pg_dump piped through gzip. They’re stored on the VPS as .sql.gz files. You can trigger backups manually from the dashboard or API. Backup files are named with UTC timestamps: 20260319_120000.sql.gz.

API keys

API keys provide programmatic access to the DBHost REST API. Each key has:
  • A prefix (visible, for identification)
  • A hashed secret (stored securely, shown only once on creation)
  • A label (your description)
  • Last used timestamp
Use API keys with the Authorization: Bearer <key> header.

Audit log

Every significant action is recorded in the audit log with:
  • Who performed the action (user ID)
  • What action was taken (create, delete, reset_password, etc.)
  • Which resource was affected (database name, user ID)
  • When it happened
  • Details (JSONB, action-specific context)
Admins can view the full audit log at /admin/audit-log.

Roles

DBHost has two roles:
RoleAccess
userOwn databases, own API keys, own settings
adminEverything above + all databases, all users, health monitoring, audit logs, ban/delete users
Admins are promoted via a CLI script. The first admin must be promoted manually after signing up.