See Release Notes for what's new in the latest release, v19.2.12. To upgrade to this release from an older version, see Cluster Upgrade.
Download the Binary
The CockroachDB binary for Linux requires glibc
, libncurses
, and tzdata
, which are found by default on nearly all Linux distributions, with Alpine as the notable exception.
-
Download the CockroachDB archive for Linux, and extract the binary:
$ curl https://binaries.cockroachdb.com/cockroach-v19.2.12.linux-amd64.tgz | tar -xz
-
Copy the binary into your
PATH
so it's easy to execute cockroach commands from any shell:cp -i cockroach-v19.2.12.linux-amd64/cockroach /usr/local/bin/
If you get a permissions error, prefix the command with
sudo
. -
Keep up-to-date with CockroachDB releases and best practices:
Use Kubernetes
To orchestrate CockroachDB using Kubernetes, either with configuration files or the Helm package manager, use the following tutorials:
Use Docker
-
Install Docker for Linux. Please carefully check that you meet all prerequisites.
-
Confirm that the Docker daemon is running in the background:
$ docker version
If you do not see the server listed, start the Docker daemon.
Note:On Linux, Docker needs sudo privileges. -
Pull the image for the v19.2.12 release of CockroachDB from Docker Hub:
$ sudo docker pull cockroachdb/cockroach:v19.2.12
-
Keep up-to-date with CockroachDB releases and best practices:
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.12.12+ is required, but 1.13 and above is not recommended. Older versions might work via make build IGNORE_GOVERS=1
.Bash Versions 4+ are preferred, but later releases from the 3.x series are also known to work. CMake Versions 3.8+ 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.
-
Download the CockroachDB v19.2.12 source archive, and extract the sources:
$ curl https://binaries.cockroachdb.com/cockroach-v19.2.12.src.tgz | tar -xz
In the extracted directory, run
make build
:cd cockroach-v19.2.12
make build
The build process can take 10+ minutes, so please be patient.
-
Install the
cockroach
binary into/usr/local/bin/
so it's easy to execute cockroach commands from any directory: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 yourPATH
. -
Keep up-to-date with CockroachDB releases and best practices:
What's next?
- If you're just getting started with CockroachDB:
- Start a cluster locally and talk to it via the built-in SQL client
- Learn more about CockroachDB SQL
- Build a simple application with CockroachDB using Postgres-compatible client drivers and ORMs
- Explore core CockroachDB features like automatic replication, rebalancing, and fault tolerance
- If you're ready to run CockroachDB in production: