Databases

A managed database is a cluster the platform runs, backs up and keeps patched. You get credentials and a TLS endpoint; you never see a server.

Engines and versions

PostgreSQL 17 (default), 16 and 15, run on CloudNativePG. MariaDB is also offered. Automatic backups and point-in-time restore are PostgreSQL features; the platform refuses them for MariaDB and says so.

cloud db engines

Create

cloud db create orders --engine postgresql --region zm-lusaka-central-1 --wait
cloud db create orders --engine postgresql --version 16 --size db-2

Status runs provisioning → ready. Sizes are pricing tiers (see pricing); each includes CPU, memory and storage.

Connect

cloud db credentials orders --format url    # postgresql://user:pass@host:5432/db?sslmode=require
eval "$(cloud db credentials orders --format env)" && psql

Credentials include a public host (TLS required) and an internal host reachable only from apps in the same region — use the internal one from your apps; it never leaves the cluster. Reading credentials needs the member role or above; viewers can see that a database exists, not how to log in.

Start, stop, restart

cloud db stop orders       # compute stops; data and backups stay; storage is still billed
cloud db start orders
cloud db restart orders

Backups (PostgreSQL)

Turn on automatic backups and the platform takes a base backup daily at 02:00 and archives every write continuously, so you can restore to any moment inside the retention window — not just to a nightly snapshot.

cloud db backup enable orders --retention 3d
cloud db backup create orders          # an extra one now
cloud db backup list orders

Retention is a time window, not a count: 3d keeps every backup and archive from the last three days, which with a daily schedule means two or three base backups. Backups are stored in object storage in the same region.

Restore

cloud db restore orders --to orders-recovered --at 2026-09-04T10:15:00Z

A restore always creates a new database and leaves the source untouched — the platform will not overwrite a live database, because an application still writing to it would lose exactly the data the restore was meant to save. Omit --at to restore to the latest backup. When the new database is ready, take its credentials and repoint your app.

Logs and delete

cloud db logs orders -f
cloud db delete orders

Deleting removes the cluster and its backups. The CLI confirms by name; --yes skips that in scripts.