Setting Up a Local CockroachDB Cluster
Guides you through downloading, installing, and starting a local CockroachDB cluster for development. Uses the official binary -- no Docker or external runtime dependencies required.
When to Use This Skill
- Developer asks to "set up CockroachDB" or "start a local database"
- No CockroachDB cluster is reachable
- Developer wants to build an app with CockroachDB from scratch
- Setting up a new development environment
Prerequisites
- macOS (Intel or Apple Silicon), Linux (Intel or ARM), or Windows (Intel)
curlorwgetavailable for downloading the binary- ~500 MB disk space per node
- Ports 26257-26259 (SQL), 26357-26359 (RPC), and 8080-8082 (DB Console) available for a 3-node cluster
Step 1: Detect Platform and Download
Detect the OS and architecture, then download the appropriate binary.
Download URLs
Base URL: https://binaries.cockroachdb.com/
Replace {VERSION} with the desired release (e.g., 25.4.9). See CockroachDB Releases for the latest GA version.
Installation
If cockroach is already on PATH, skip the download.
Step 2: Start the Cluster
A 3-node cluster is recommended for development because it exercises replication, range distribution, leaseholder balancing, and survival goals -- core CockroachDB capabilities that a single node cannot demonstrate.
3-Node Cluster (Recommended)
Single-Node (Lightweight)
For minimal resource usage when full cluster capabilities are not needed:
Step 3: Verify the Cluster
Connection Details
Environment Variables for MCP Toolbox
Stopping the Cluster
Destroying All Data
Air-Gapped / Restricted Environments
For environments without internet access:
- Pre-download the binary on an allowed machine
- Transfer to the target machine via approved channels
- Place at
~/.cockroachdb/bin/cockroachor any PATH location
What a 3-Node Cluster Enables
Safety Considerations
- The cluster runs in insecure mode (no TLS, no authentication) -- suitable for local development only.
- Data persists in
$HOME/.cockroachdb/dataacross restarts. - The binary and data are user-local (
~/.cockroachdb/) -- nosudoor system modifications. - A 3-node cluster uses approximately 750 MB of RAM total.


