Quickstart
Provision a managed database and open a live, governed connection to it — from the CLI, in a few minutes.
This walkthrough provisions a managed PostgreSQL cluster and opens a live
connection to it. It assumes you've installed the CLI
and run relay login.
Select an organization and workspace
relay org use <org>
relay ws use <workspace>See what you can provision into
relay db regionsThis lists the clouds and regions available to your organization, and the engines each one offers.
Provision a cluster
--tier sets the machine size; R5 is the free-plan size. Provisioning is
asynchronous — --wait blocks until the cluster is ready.
relay db create pg-quickstart \
--engine postgres --version 18 \
--cloud aws --region us-east-1 \
--tier R5 --waitOn a paid plan, pick a larger tier and add --ha for a replica with automatic
failover.
On the free plan, your organization's one database slot holds the sample
database test. Delete it first with relay db list and
relay db delete <id>.
Backups are enabled by default. Check status any time:
relay db list
relay db status <id>Create a database user
Managed clusters issue bounded users with auto-generated, show-once passwords (never superuser or replication). Create one from the dashboard under the cluster's Users tab (the CLI has no database-user commands; the API and Terraform can also manage them), and copy the password immediately — it is not shown again.
Connect
relay connect pg-quickstartThis opens a local proxy brokered through an agent, applying the masking and
policies your plan includes. relay connect prints the local address it's listening on (and a ready
psql command) — point your client there:
psql -h 127.0.0.1 -p <printed-port> -U <db-user> <db>Stop the tunnel with Ctrl+C in the terminal that runs relay connect
(relay status lists open tunnels).
The free plan includes one R5 single-node database (up to 5 GiB) per organization. Your account starts with a sample database in that slot; delete it to create your own. More or larger databases, high availability, and masking require a paid plan — see Plans.
Where to go next
- Managed databases — backups, scaling, parameters, users.
- Access & governance — masking, policies, grants, audit.
- Connect existing databases — govern databases you already run.