What's Next?

Quick start a single- or multi-node cluster locally and talk to it via the built-in SQL client.

Note:

By default, each node of a CockroachDB cluster periodically shares anonymous usage details with Cockroach Labs. For an explanation of the details that get shared and how to opt-out of reporting, see Diagnostics Reporting.

Build from Source

Install the following prerequisites, as necessary:

C++ compiler

Must support C++ 11. GCC prior to 6.0 does not work due to this issue. On macOS, Xcode should suffice.

Go

Version 1.8.1 is required.

Bash

Versions 4+ are preferred, but later releases from the 3.x series are also known to work.

CMake

Versions 3.81+ are known to work.

Autoconf

Version 2.68 or higher is required.

A 64-bit system is strongly recommended. Building or running CockroachDB on 32-bit systems has not been tested. You'll also need at least 2GB of RAM. If you plan to run our test suite, you'll need closer to 4GB of RAM.

You can also download other versions of the binary listed on our Releases page.

In the extracted directory, run make build:

copy

icon/buttons/copy

cd cockroach-v1.0.7

copy

icon/buttons/copy

make build

The build process can take 10+ minutes, so please be patient.

Note:

The default binary contains core open-source functionality covered by the Apache License 2 (APL2) and enterprise functionality covered by the CockroachDB Community License (CCL). To build a pure open-source (APL2) version excluding enterprise functionality, use make buildoss. See this blog post for more details.

Install the cockroach binary into /usr/local/bin so it's easy to execute cockroach commands from any directory:

copy

icon/buttons/copy

make install

If you get a permissions error, prefix the command with sudo.

You can also execute the cockroach binary directly from its built location, ./src/github.com/cockroachdb/cockroach/cockroach, but the rest of the documentation assumes you have the binary on your PATH.

Get future release notes emailed to you:

What's Next?

Quick start a single- or multi-node cluster locally and talk to it via the built-in SQL client.

Note:

By default, each node of a CockroachDB cluster periodically shares anonymous usage details with Cockroach Labs. For an explanation of the details that get shared and how to opt-out of reporting, see Diagnostics Reporting.

Use Docker

Warning:

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.

Install Docker for Mac. Please carefully check that you meet all prerequisites.

What's Next?

Quick start a multi-node cluster across multiple Docker containers on a single host, using Docker volumes to persist node data, or explore running a physically distributed cluster in containers using orchestration tools.

Note:

By default, each node of a CockroachDB cluster periodically shares anonymous usage details with Cockroach Labs. For an explanation of the details that get shared and how to opt-out of reporting, see Diagnostics Reporting.

There are three ways to install CockroachDB on Linux. See Release Notes for what's new in the latest release, v1.0.7.

What's Next?

Quick start a single- or multi-node cluster locally and talk to it via the built-in SQL client.

Note:

By default, each node of a CockroachDB cluster periodically shares anonymous usage details with Cockroach Labs. For an explanation of the details that get shared and how to opt-out of reporting, see Diagnostics Reporting.

Build from Source

Install the following prerequisites, as necessary:

C++ compiler

Must support C++ 11. GCC prior to 6.0 does not work due to this issue. On macOS, Xcode should suffice.

Go

Version 1.8, or a later version in the 1.8 series, is required.

Bash

Versions 4+ are preferred, but later releases from the 3.x series are also known to work.

CMake

Versions 3.81+ are known to work.

Autoconf

Version 2.68 or higher is required.

A 64-bit system is strongly recommended. Building or running CockroachDB on 32-bit systems has not been tested. You'll also need at least 2GB of RAM. If you plan to run our test suite, you'll need closer to 4GB of RAM.

You can also download other versions of the binary listed on our Releases page.

In the extracted directory, run make build:

copy

icon/buttons/copy

cd cockroach-v1.0.7

copy

icon/buttons/copy

make build

The build process can take 10+ minutes, so please be patient.

Note:

The default binary contains core open-source functionality covered by the Apache License 2 (APL2) and enterprise functionality covered by the CockroachDB Community License (CCL). To build a pure open-source (APL2) version excluding enterprise functionality, use make buildoss. See this blog post for more details.

Install the cockroach binary into /usr/local/bin so it's easy to execute cockroach commands from any directory:

copy

icon/buttons/copy

make install

If you get a permissions error, prefix the command with sudo.

You can also execute the cockroach binary directly from its built location, ./src/github.com/cockroachdb/cockroach/cockroach, but the rest of the documentation assumes you have the binary on your PATH.

Get future release notes emailed to you:

What's Next?

Quick start a single- or multi-node cluster locally and talk to it via the built-in SQL client.

Note:

By default, each node of a CockroachDB cluster periodically shares anonymous usage details with Cockroach Labs. For an explanation of the details that get shared and how to opt-out of reporting, see Diagnostics Reporting.

Use Docker

Warning:

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.

Install Docker for Linux. Please carefully check that you meet all prerequisites.

What's Next?

Quick start a multi-node cluster across multiple Docker containers on a single host, using Docker volumes to persist node data, or explore running a physically distributed cluster in containers using orchestration tools.

Note:

By default, each node of a CockroachDB cluster periodically shares anonymous usage details with Cockroach Labs. For an explanation of the details that get shared and how to opt-out of reporting, see Diagnostics Reporting.

There are two ways to install CockroachDB on Windows. See Release Notes for what's new in the latest release, v1.0.7.

Download the Binary

Warning:

Native CockroachDB on Windows requires Windows 8 or higher, is experimental, and has not been extensively tested by Cockroach Labs. This prebuilt binary is provided as a convenience for local development and experimentation; production deployments of CockroachDB on Windows are strongly discouraged.

Open PowerShell, navigate to the directory containing the binary, and make sure the CockroachDB executable works:

copy

icon/buttons/copy

PS C:\cockroach-v1.0.7.windows-6.2-amd64> .\cockroach.exe version

Get future release notes emailed to you:

What's Next?

Quick start a single- or multi-node cluster locally and talk to it via the built-in SQL client.

Note:

By default, each node of a CockroachDB cluster periodically shares anonymous usage details with Cockroach Labs. For an explanation of the details that get shared and how to opt-out of reporting, see Diagnostics Reporting.

Use Docker

Warning:

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.

Docker for Windows requires 64bit Windows 10 Pro and Microsoft Hyper-V. Please see the official documentation for more details. Note that if your system does not satisfy the stated requirements, you can try using Docker Toolbox.

Open PowerShell and confirm that the Docker daemon is running in the background:

PS C:\Users\username> docker version

If you don't see the server listed, start Docker for Windows.

Share your local drives. This makes it possible to mount local directories as data volumes to persist node data after containers are stopped or deleted.

What's Next?

Quick start a multi-node cluster across multiple Docker containers on a single host, using Docker volumes to persist node data, or explore running a physically distributed cluster in containers using orchestration tools.

Note:

By default, each node of a CockroachDB cluster periodically shares anonymous usage details with Cockroach Labs. For an explanation of the details that get shared and how to opt-out of reporting, see Diagnostics Reporting.