Connect to CockroachDB from a Mac

Last updated: December 1, 2026. Tested with SQLPro Studio on macOS 26 against CockroachDB Cloud (v26.2) and a local CockroachDB v26.4 cluster.

CockroachDB speaks the PostgreSQL wire protocol, so you connect to it as a PostgreSQL server. In SQLPro Studio, choose New › PostgreSQL / Redshift, enter the cluster host, port 26257, your SQL user and password, and the database (defaultdb unless you made another one). For CockroachDB Cloud set SSL mode to verify-full, then click Save & Connect. You can also paste the whole connection string from the Cloud Console into the Connection string field instead.

You don't need to install a driver or download a certificate for CockroachDB Cloud Basic or Standard clusters. Their server certificates are signed by Let's Encrypt, and SQLPro Studio ships with a set of trusted root certificates, so verify-full works without a root.crt file. SQLPro for Postgres, our PostgreSQL-only Mac app, uses the same connection code, so the steps are the same there.

What you need

Step 1: Copy the connection string from CockroachDB Cloud

  1. Open your cluster in the CockroachDB Cloud Console and click Connect in the top right corner.
  2. Pick the SQL user and the database. Under Select option/language, choose General connection string.
  3. Copy the connection string. It looks like this:
postgresql://maria:YOUR_PASSWORD@your-cluster-1234.j77.aws-us-east-1.cockroachlabs.cloud:26257/defaultdb?sslmode=verify-full

The parts you need are the SQL user (maria), the password, the host (everything between @ and :26257), the port (26257) and the database (defaultdb).

On Standard and Advanced clusters, network access is closed until you allow it. Add your IP address under Networking › IP Allowlist first. Basic clusters accept connections from any address by default.

Running CockroachDB yourself?

The SQL port is also 26257. A local test cluster started with cockroach start-single-node --insecure takes the user root with no password, and you set SSL mode to disable. Cockroach Labs says insecure mode is for testing only. A secure cluster normally signs users in with client certificates: in the Security (TLS/SSL) section, choose your ca.crt as the Root certificate, client.<user>.crt as the Client certificate and client.<user>.key as the Client key. We tested password sign-in on CockroachDB Cloud and an insecure local cluster; we have not tested certificate sign-in.

Step 2: Add the connection in SQLPro Studio

Click Connect…, then the + menu, and choose PostgreSQL / Redshift. There is no separate CockroachDB connection type, and you don't need one. Then fill in the form one of two ways.

Option A: fill in the fields

The SQLPro Studio connection form filled in for a CockroachDB Cloud cluster: port 26257, database defaultdb, SSL mode verify-full
The SQLPro Studio connection form filled in for a CockroachDB Cloud cluster: port 26257, database defaultdb, SSL mode verify-full

Option B: paste the connection string

Expand Connection string and paste the whole string from the Connect dialog. SQLPro Studio reads the host, port and login from it and uses the string's sslmode=verify-full. If your password has special characters, they must be URL-encoded in the string (for example ! becomes %21), or use Option A instead.

Step 3: Connect and run a query

Click Save & Connect. The cluster appears in the sidebar with its CockroachDB version. Under each database you see the public schema with its tables, views, functions, types and sequences, plus CockroachDB's own crdb_internal schema. Click New Query to open a SQL editor tab, and press Shift-Command-E to run everything in it; you get a result for each statement.

SQLPro Studio connected to CockroachDB: two queries against the movr sample database, with a result for each
SQLPro Studio connected to CockroachDB: two queries against the movr sample database, with a result for each

Want sample data to try this on? cockroach workload init movr loads the movr ride-sharing database used in the screenshot and in Cockroach Labs' own tutorials.

Things that work differently from PostgreSQL

Troubleshooting

The connection times out

On Standard and Advanced clusters, add your current IP address under Networking › IP Allowlist in the Cloud Console. Also check that the port is 26257 and not 5432.

password authentication failed for user

Check the user and password, or set a new password under SQL Users in the Cloud Console. If you pasted a connection string, make sure special characters in the password are URL-encoded.

certificate verify failed

Basic and Standard clusters use publicly trusted certificates, so this usually means the host name is wrong. Copy it again from the Connect dialog. Advanced clusters use their own certificate authority: download the CA certificate from the Connect dialog and choose it as the Root certificate in the Security section.

database "..." does not exist

New clusters come with defaultdb. Use that, or create your database first with CREATE DATABASE.

Questions people ask

Does SQLPro Studio work with CockroachDB?

Yes. CockroachDB uses the PostgreSQL wire protocol, and SQLPro Studio connects to it with a PostgreSQL connection. We tested it on December 1, 2026 against CockroachDB Cloud (v26.2) with password sign-in and SSL mode verify-full, and against a local v26.4 cluster: browsing schemas and tables and running queries both work.

What port does CockroachDB use?

26257 for SQL connections, both on CockroachDB Cloud and on a self-hosted cluster. Change the port in the connection form from the PostgreSQL default of 5432.

Which SSL mode should I use for CockroachDB Cloud?

verify-full, which is what the Cloud Console connection string uses. On Basic and Standard clusters the certificate is signed by Let's Encrypt and SQLPro Studio includes trusted root certificates, so you do not need to download a CA certificate. Advanced clusters need their own CA certificate selected as the root certificate.

Do I need to pick a special connection type for CockroachDB?

No. Choose PostgreSQL / Redshift. CockroachDB is compatible with the PostgreSQL protocol, so the regular PostgreSQL connection works.

Can I use SQLPro for Postgres instead of SQLPro Studio?

Yes. SQLPro for Postgres is our PostgreSQL-only Mac app and uses the same connection code, so the steps on this page are the same.

Is SQLPro Studio free?

There is a free 7-day trial on macOS. After that it is $15.99 a month or $99.99 a year (covering macOS, iPhone, iPad, Android and Windows), or $219.99 for a lifetime license on one platform. Students can get it free for a year.

More setup guides: databases and cloud services SQLPro Studio works with, including Neon and Dolt. Comparing clients? See the best database software for Mac.