CockroachDB on macOS is experimental and not suitable for production deployments.
Use Homebrew (Recommended)
The easiest way to install CockroachDB on macOS is using Homebrew. For CockroachDB v22.2.x and above, Homebrew installs binaries for your system architecture, either Intel or ARM (Apple Silicon).Install Homebrew
If you don’t have Homebrew installed, install it first:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install CockroachDB
brew install cockroachdb/tap/cockroach
Download the binary
Alternatively, you can download the CockroachDB binary directly:Download the archive
Visit the Releases page and download the CockroachDB archive for your architecture (Intel or ARM). Extract and install
Extract the archive and copy the binary to your PATH:tar -xzf cockroach-{VERSION}.darwin-{ARCHITECTURE}.tgz
sudo cp -i cockroach-{VERSION}.darwin-{ARCHITECTURE}/cockroach /usr/local/bin/
Install spatial libraries (optional)
If you plan to use CockroachDB’s spatial features, install the GEOS libraries:# Create the library directory
sudo mkdir -p /usr/local/lib/cockroach
# Copy the GEOS libraries
sudo cp -i cockroach-{VERSION}.darwin-{ARCHITECTURE}/lib/libgeos.dylib /usr/local/lib/cockroach/
sudo cp -i cockroach-{VERSION}.darwin-{ARCHITECTURE}/lib/libgeos_c.dylib /usr/local/lib/cockroach/
Verify spatial features
Start a demo cluster and test spatial queries:In the SQL shell:SELECT ST_IsValid(ST_MakePoint(1,2));
You should see:st_isvalid
--------------
true
(1 row)
Use Docker
Run CockroachDB in a Docker container:docker pull cockroachdb/cockroach:latest-v25.3
Limitations
On macOS ARM systems, spatial features are currently disabled due to code signing issues with GEOS libraries. Use the Intel binary or Docker container if you need spatial features.
Download the binary (Recommended)
The CockroachDB binary for Linux requires glibc, libncurses, and tzdata, which are found by default on nearly all Linux distributions.Download CockroachDB
Visit the Releases page and download the archive for your architecture. Replace {VERSION} with the version you want (e.g., v25.3.0) and {ARCHITECTURE} with linux-amd64 for Intel or linux-arm64 for ARM.curl https://binaries.cockroachdb.com/cockroach-{VERSION}.{ARCHITECTURE}.tgz | tar -xz
Install the binary
sudo cp -i cockroach-{VERSION}.{ARCHITECTURE}/cockroach /usr/local/bin/
Verify installation
which cockroach
cockroach version
Install spatial libraries (optional)
If you plan to use spatial features, install the GEOS libraries:# Create the library directory
sudo mkdir -p /usr/local/lib/cockroach
# Copy the GEOS libraries
sudo cp -i cockroach-{VERSION}.{ARCHITECTURE}/lib/libgeos.so /usr/local/lib/cockroach/
sudo cp -i cockroach-{VERSION}.{ARCHITECTURE}/lib/libgeos_c.so /usr/local/lib/cockroach/
Verify spatial features
In the SQL shell:SELECT ST_IsValid(ST_MakePoint(1,2));
Use Docker
Running a stateful application like CockroachDB in Docker is more complex than most Docker use cases. Use Docker only if you’re experienced with container orchestration.
Docker images are multi-platform and contain binaries for both Intel and ARM architectures:Pull the CockroachDB image
docker pull cockroachdb/cockroach:latest-v25.3
Use Kubernetes
To orchestrate CockroachDB using Kubernetes:ARM limitations
CockroachDB on ARM has the following limitations:
- Floating point operations may yield different results on ARM than on Intel
- In production, all cluster nodes should have identical CPU architecture
- Mixed Intel and ARM clusters are supported only during migration
Build from source
For advanced users, you can build CockroachDB from source.CockroachDB support for Windows is experimental. For production use, deploy on Linux.
Download the executable (Recommended)
Download CockroachDB
Visit the Releases page and download the Windows archive containing cockroach.exe. Extract the archive
Extract the archive and optionally copy cockroach.exe to a directory in your PATH.
Use PowerShell script
Alternatively, use PowerShell to download and install:$ErrorActionPreference = "Stop";
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
$ProgressPreference = 'SilentlyContinue';
$null = New-Item -Type Directory -Force $env:appdata/cockroach;
Invoke-WebRequest -Uri https://binaries.cockroachdb.com/cockroach-{VERSION}.windows-6.2-amd64.zip -OutFile cockroach.zip;
Expand-Archive -Force -Path cockroach.zip;
Copy-Item -Force "cockroach/cockroach-{VERSION}.windows-6.2-amd64/cockroach.exe" -Destination "C:\Program Files\CockroachDB";
$Env:PATH += ";C:\Program Files\CockroachDB"
Replace {VERSION} with the version you want to install.Use Docker
On Windows, Docker creates a Linux container:Pull the image
docker pull cockroachdb/cockroach:latest-v25.3
Use Kubernetes
To orchestrate CockroachDB with Kubernetes on Windows, see Orchestrate a local cluster with Kubernetes.