Skip to main content
CockroachDB Cloud provides fully managed database clusters. You can create serverless or advanced clusters using the ccloud CLI or the web console.

Install ccloud CLI

The ccloud CLI allows you to create, manage, and connect to CockroachDB Cloud clusters from the command line.
1

Download and install ccloud

Download the appropriate version for your operating system and add it to your PATH.
2

Log in to CockroachDB Cloud

Open a browser window to authenticate:
ccloud auth login
If you’re a member of multiple organizations, specify your organization:
ccloud auth login --org {organization-label}
For headless servers, use the --no-redirect flag:
ccloud auth login --no-redirect

Quick start with ccloud quickstart

The fastest way to get started is using the interactive quickstart command:
ccloud quickstart
This command guides you through:
  • Logging in to CockroachDB Cloud
  • Creating a new serverless cluster
  • Connecting to your cluster
The quickstart command creates a CockroachDB Serverless cluster in the default cloud provider (GCP) and the closest region.

Create a serverless cluster

Create a serverless cluster with default settings:
ccloud cluster create
This creates a cluster with:
  • Cloud provider: GCP
  • Region: Closest to your location
  • Auto-generated cluster name
  • Spend limit: $0 (free tier)

Create an advanced cluster

For production workloads, create a CockroachDB Advanced cluster:
ccloud cluster create dedicated my-cluster us-central1:3 --cloud GCP --vcpus 4 --storage-gib 110
ccloud cluster create dedicated my-cluster us-central1:3 \
  --cloud GCP \
  --vcpus 4 \
  --storage-gib 110
For optimal performance, configure the same number of nodes in each region.

Configure IP allowlist

For Advanced clusters, you must configure an IP allowlist to allow network connections:
1

Create an allowlist entry

Allow connections from a specific IP address:
ccloud cluster networking allowlist create my-cluster 1.1.1.1/32 --sql --ui
This allows:
  • --sql - CockroachDB SQL shell connections
  • --ui - DB Console access
2

List allowlist entries

View all IP allowlist entries:
ccloud cluster networking allowlist list my-cluster
3

Update an entry

Add a descriptive name:
ccloud cluster networking allowlist update my-cluster 1.1.1.1/32 --name home
Use CIDR notation for IP ranges. For a single IP address, use /32 (e.g., 1.1.1.1/32).

Connect to your cluster

Using the SQL client

Connect directly using the ccloud cluster sql command:
ccloud cluster sql my-cluster
If no SQL user exists, you’ll be prompted to create one.

Using SSO authentication

Connect using single sign-on:
ccloud cluster sql --sso my-cluster
For remote machines:
ccloud cluster sql --sso --no-redirect my-cluster

Get connection information

Retrieve the connection URL:
ccloud cluster sql --connection-url my-cluster
Get individual connection parameters:
ccloud cluster sql --connection-params my-cluster

Manage SQL users

Create a new SQL user with admin privileges:
ccloud cluster user create my-cluster maxroach
You’ll be prompted to set a password. Admin users have full privileges for all databases and tables.

Manage clusters

List clusters

ccloud cluster list
View all clusters in your organization with details like plan type, state, and version.

View cluster info

ccloud cluster info my-cluster
Get detailed information about a specific cluster.

Delete cluster

ccloud cluster delete my-cluster
Permanently delete a cluster. Cannot be undone.

Disable telemetry

ccloud settings set --disable-telemetry=true
Opt out of anonymized telemetry collection.
You cannot delete a cluster while it’s in CLUSTER_STATE_CREATING status. Wait until it reaches CLUSTER_STATE_CREATED.

Next steps

Build docs developers (and LLMs) love