Provision a Database¶
PaaS Runtime ships managed PostgreSQL (CNPG), Valkey (Redis-compatible), and OpenSearch as add-ons. This guide walks through provisioning, connecting, backups, and restores.
Provision PostgreSQL¶
Output:
✓ Provisioning postgres (standard)
Cluster: pg-inst-7d92
Version: PostgreSQL 16.2
Memory: 1Gi
Storage: 20Gi
HA: primary + 1 replica
Backups: nightly + WAL streaming → S3
✓ Bound to app hello-paas as DATABASE_URL
✓ App will redeploy with the new env var (rollout in progress)
The CNPG operator creates a Cluster CR in your tenant namespace. PaaS injects the connection string as DATABASE_URL, plus the components separately:
| Variable | Example |
|---|---|
DATABASE_URL |
postgres://user:pass@pg-inst-7d92.svc:5432/dbname |
DATABASE_HOST |
pg-inst-7d92.svc |
DATABASE_PORT |
5432 |
DATABASE_NAME |
dbname |
DATABASE_USER |
user |
DATABASE_PASSWORD |
pass |
Plans¶
| Plan | Memory | Storage | HA | Backups | Price (eur/mo) |
|---|---|---|---|---|---|
| free | 256Mi | 1Gi | none | none | 0 |
| starter | 512Mi | 5Gi | none | nightly | 9 |
| standard | 1Gi | 20Gi | primary + 1 replica | WAL stream + nightly | 39 |
| pro | 4Gi | 100Gi | primary + 2 replicas | WAL stream + nightly + cross-region | 159 |
Reveal credentials¶
Or via the dashboard: Apps → hello-paas → Add-ons → Reveal credentials.
Run a one-off psql¶
Drops you into an interactive psql session inside the cluster network (no port-forwarding needed).
Backups¶
Backups are automatic for starter, standard, pro plans. List them:
$ paas addons:backups db
TIMESTAMP SIZE KIND
2026-05-04T02:00:00 142 MB nightly
2026-05-03T02:00:00 140 MB nightly
2026-05-02T02:00:00 138 MB nightly
Trigger a backup manually:
Restore (PITR)¶
Point-In-Time Recovery — restore to any second within retention:
This creates a new cluster pg-inst-7d92-restore-<timestamp>. Once verified, swap the binding:
The old cluster stays available 24h before garbage collection.
Read replicas¶
standard and pro plans support read replicas:
DATABASE_REPLICA_URL is injected for read traffic. Use a routing library (e.g. pgPool, read_replica_aware ORM driver) to direct SELECT queries.
Provision Valkey (Redis)¶
Injects REDIS_URL. Compatible with the Redis 7 protocol.
Provision OpenSearch¶
Injects OPENSEARCH_URL + OPENSEARCH_USER + OPENSEARCH_PASSWORD.