Skip to main content
Mac To try CockroachDB Cloud instead of running CockroachDB yourself, refer to the . This page refers to CockroachDB v26.1. Note: CockroachDB on macOS is experimental and not suitable for production deployments. Use one of the options below to install CockroachDB. To upgrade an existing cluster, refer to . For limitations specific to geospatial features, refer to Limitations.

Use Homebrew

  1. Install Homebrew.
  2. Instruct Homebrew to install CockroachDB:
  3. Keep up-to-date with CockroachDB releases and best practices:
Note: If you previously installed CockroachDB via Homebrew, you can the CockroachDB binary to the next major version or to a patch version using HomeBrew. After updating the binary on each node, restart the cockroach process on the node. When upgrading to a new major version, you must complete additional steps to the upgrade. If you need to upgrade through multiple major versions, you must complete each major-version upgrade separately, including finalizing the upgrade, before beginning the next one. Before starting the upgrade, review the , including temporary limitations during the upgrade. To upgrade CockroachDB via HomeBrew:

Download the binary

  1. Visit to download the CockroachDB archive for the architecture of your macOS host. The archive contains the cockroach binary and the supporting libraries that are used to provide . You can download the binary using a web browser or you can copy the link and use a utility like curl to download it. If you download the ARM binary using a web browser and you plan to use CockroachDB’s spatial features, an additional step is required before you can install the library, as outlined in the next step. Extract the archive and optionally copy the cockroach binary into your PATH so you can execute from any shell. If you get a permission error, use sudo. Note: If you plan to use CockroachDB’s , you must complete all of the following steps. Otherwise, your installation is now complete.
  2. CockroachDB uses custom-built versions of the GEOS libraries. To install those libraries:
    1. Note that spatial features are currently disabled for Mac ARM users, for whom these steps do not apply. For an upcoming patch release where this functionality is reenabled, if you downloaded the CockroachDB ARM binary archive using a web browser, macOS flags the GEOS libraries in the extracted archive as quarantined. This flag must be removed before CockroachDB can use the libraries. To remove the quarantine flag from the libraries: This step is not required for Intel systems.
    2. Copy these libraries to one of the locations where CockroachDB expects to find them. By default, CockroachDB looks for external libraries in /usr/local/lib/cockroach or a lib subdirectory of the CockroachDB binary’s current directory. If you place these libraries in another location, you must pass the location in the --spatial-libs flag to cockroach start. The instructions below assume the /usr/local/lib/cockroach location.
      1. Create the directory where the external libraries will be stored:
      2. Copy the library files to the directory:
        If you get a permissions error, prefix the command with sudo.
  3. Verify that CockroachDB can execute spatial queries.
    1. Make sure the cockroach binary you just installed is the one that runs when you type cockroach in your shell:
    2. Start a temporary, in-memory cluster using :
    3. In the demo cluster’s interactive SQL shell, run the following command to test that the spatial libraries have loaded properly:
      You should see the following output: If your cockroach binary is not properly accessing the dynamically linked C libraries in /usr/local/lib/cockroach, it will output an error message like the one below.
  • Keep up-to-date with CockroachDB releases and best practices:

Use Kubernetes

To orchestrate CockroachDB using Kubernetes, use the official CockroachDB operator. You can evaluate a CockroachDB Kubernetes deployment on a local machine with minikube.

Use Docker

Build from source

See the public wiki for guidance. When building on the ARM architecture, refer to Limitations.

Limitations

CockroachDB runtimes built for the ARM architecture have the following limitations:
  • CockroachDB on ARM for macOS is experimental and is not yet qualified for production use and not eligible for support or uptime SLA commitments.
  • Clusters with a mix of Intel and ARM nodes are untested. Cockroach Labs recommends that all cluster nodes have identical CockroachDB versions, hardware, and software.
  • Floating point operations may yield different results on ARM than on Intel, particularly Fused Multiply Add (FMA) intrinsics.
  • When building from source on ARM, consider disabling FMA intrinsics in your compiler. For GCC, refer to Options That Control Optimization in the GCC documentation.

What’s next?

Limitations

On macOS ARM systems, are disabled due to an issue with macOS code signing for the GEOS libraries. Users needing spatial features on an ARM Mac may instead run the Intel binary or use theDocker container image.