Open a Ready database and select Connect. The console shows the endpoint and the connection steps for that database.
Hosted direct TLS
Follow Create a hosted database for the PostgreSQL 19 client, password and TLS instructions.
Local relay
The local relay forwards PostgreSQL traffic from your machine to the database’s WebSocket endpoint.
- In the console, open a Ready database and select Connect.
- Copy the displayed relay command into a terminal. Leave it running. The default loopback port is 55432.
- Select Issue password. A new password invalidates the previous password for that database user. Keep the password out of shell history and use the client prompt.
- Run the displayed psql command in a second terminal. It already includes the correct database and user names.
- Run the following query, then close the session with
\qwhen you’re finished.
SELECT current_database(), current_user;
On the verified checkout, the stock SSL-enabled PostgreSQL 18.7 client is in .local/pgtools/tls-install/bin. A fresh checkout can use psql from a PostgreSQL 18 installation.
Connect a local application
To use a PostgreSQL driver, start the relay on your application server. On the ready database page, choose Issue password, then Copy connection string. Save it in your server’s DATABASE_URL secret and restart the app so its connection pool picks up the change. A subsequent rotation also requires updating this secret. The URL connects to the relay over loopback. Use SELECT current_database(), current_user to verify the target from the app. The compatibility page lists the clients and workflows exercised locally.
To use two databases from the same machine at the same time, leave the first relay running on 55432. Start the second database’s displayed relay command with a free port such as --port 55433. In the second app’s connection string change only the port to 55433. Each relay forwards to the single database in its WebSocket URL.
The optional PostgreSQL TLS gateway supports certificate verification. It takes a JSON registry mapping each canonical database ID to its Worker WebSocket URL. Supply the correct database ID and SQL user from the console.
node gateway/server.mjs registry.json .local/dev/console.crt .local/dev/console.key 6543
psql "host=127.0.0.1 port=6543 dbname=$DATABASE_ID user=$SQL_USER sslmode=verify-full sslrootcert=$PWD/.local/dev/console.crt" -W