Skip to main content
This page documents the required connection configuration for . For a list of all supported cluster connection parameters, see the . For a list of community-supported third-party tools, see . CockroachDB supports both native drivers and the PostgreSQL wire protocol. Most client drivers and ORM frameworks connect to CockroachDB like they connect to PostgreSQL.

Step 1. Select your deployment

To connect to a CockroachDB Cloud cluster, you need a general connection string or connection parameters, which include the username, host, database, and port. To find these, open the Connect dialog for your cluster in the CockroachDB Cloud Console and select either General connection string or Parameters only as the option.

Step 2. Select your language and driver

Connection string format

Set environment variable

Set a DATABASE_URL environment variable to your connection string:

Connect to the cluster

To connect to CockroachDB with node-postgres, create a new Client object with a connection string.For example:
Where DATABASE_URL is an environment variable set to a valid CockroachDB connection string.For more information about connecting with node-postgres, see the official node-postgres documentation.

See also