To try CockroachDB Cloud instead of running CockroachDB yourself, refer to the .
This page refers to CockroachDB v26.2. The latest supported production release is CockroachDB v26.1.
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
For CockroachDB v22.2.x and above, Homebrew installs binaries for your system architecture, either Intel or ARM (Apple Silicon). For previous releases, Homebrew installs Intel binaries. Intel binaries can run on ARM systems, but with a significant reduction in performance. CockroachDB on ARM for macOS is experimental and is not yet qualified for production use and not eligible for support or uptime SLA commitments.- Install Homebrew.
-
Instruct Homebrew to install CockroachDB:
- Keep up-to-date with CockroachDB releases and best practices:
Download the binary
For CockroachDB v22.2.x and above, download the binaries for your system architecture, either Intel or ARM (Apple Silicon). For previous releases, download Intel binaries. Intel binaries can run on ARM systems, but with a significant reduction in performance. CockroachDB on ARM for macOS is experimental and is not yet qualified for production use and not eligible for support or uptime SLA commitments.-
Visit to download the CockroachDB archive for the architecture of your macOS host. The archive contains the
cockroachbinary 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 likecurlto 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 thecockroachbinary into yourPATHso you can execute from any shell. If you get a permission error, usesudo. If you plan to use CockroachDB’s , you must complete all of the following steps. Otherwise, your installation is now complete. -
CockroachDB uses custom-built versions of the libraries. To install those libraries:
-
Note that , 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.
-
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/cockroachor alibsubdirectory of the CockroachDB binary’s current directory. If you place these libraries in another location, you must pass the location in the . The instructions below assume the/usr/local/lib/cockroachlocation.-
Create the directory where the external libraries will be stored:
-
Copy the library files to the directory:
If you get a permissions error, prefix the command with
sudo.
-
Create the directory where the external libraries will be stored:
-
Note that , 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:
-
Verify that CockroachDB can execute spatial queries.
-
Make sure the
cockroachbinary you just installed is the one that runs when you typecockroachin your shell: -
Start a temporary, in-memory cluster using :
-
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
cockroachbinary is not properly accessing the dynamically linked C libraries in/usr/local/lib/cockroach, it will output an error message like the one below.
-
Make sure the
- Keep up-to-date with CockroachDB releases and best practices:
Use Kubernetes
To orchestrate CockroachDB using Kubernetes, use the official . You can evaluate a CockroachDB Kubernetes deployment on a local machine with minikube.Use Docker
Running a stateful application like CockroachDB in Docker is more complex and error-prone than most uses of Docker. Unless you are very experienced with Docker, we recommend starting with a different installation and deployment method.
CockroachDB’s Docker images are multi-platform images that contain binaries for both Intel and ARM. Multi-platform images do not take up additional space on your Docker host.
Experimental images are not qualified for production use and not eligible for support or uptime SLA commitments.
- Install a container runtime, such as Docker Desktop.
- Verify that the runtime service is installed correctly and running in the background. Refer to the runtime’s documentation. For Docker, start a terminal and run
docker version. If you get an error, verify your installation and try again. 1. Visit Docker Hub and decide which image tag to pull. Releases are rolled out gradually. Docker images for a new release are published when other binary artifacts are published. The following tag formats are commonly used, although other tags are available.
| Tag | Example | Description |
|---|---|---|
| An exact patch | “ | Pins a cluster to an exact patch. The cluster is upgraded to a newer patch or major version only when you pull a newer tag. |
| Latest patch within a major version | latest-v26.2 | Automatically updates a cluster to the latest patch of the version you specify. This tag is recommended in production, because it keeps your cluster updated within a major version but does not automatically upgrade your cluster to a new major version. |
latest | The latest patch within the latest major version. This is the default if you do not specify a tag. It updates your cluster automatically to each new patch and major version, and is not recommended in production. |
- Pull the image. Replace with the tag from the previous step.
- Start a cluster by starting the container on each node using
docker start. The default command iscockroach start. Pass your desired flags as the final argument. For details, refer to .
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?
- If you’re just getting started with CockroachDB:
- Create a CockroachDB Cloud account where you can for CockroachDB installations
- and talk to it via the built-in SQL client
- like automatic replication, rebalancing, and fault tolerance
- If you’re ready to run CockroachDB in production:
- Review the
- or

