To deploy a free CockroachDB Cloud cluster instead of running CockroachDB yourself, see the Quickstart.
See Release Notes for what's new in the latest release, v22.2.19. To upgrade to this release from an older version, see Cluster Upgrade.
Use one of the options below to install CockroachDB.
Download the executable
Using PowerShell, run the following script to download the CockroachDB v22.2.19 archive for Windows and copy the binary into your
PATH
:$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-v22.2.19.windows-6.2-amd64.zip -OutFile cockroach.zip; Expand-Archive -Force -Path cockroach.zip; Copy-Item -Force "cockroach/cockroach-v22.2.19.windows-6.2-amd64/cockroach.exe" -Destination $env:appdata/cockroach; $Env:PATH += ";$env:appdata/cockroach"
Tip:To run a PowerShell script from a file, use syntax like
powershell.exe -Command "{path_to_script}"
.We recommend adding
;$env:appdata/cockroach
to thePATH
variable for your system environment so you can execute cockroach commands from any shell. See Microsoft's environment variable documentation for more information.In PowerShell or the Windows terminal, check that the installation succeeded:
cockroach version
Keep up-to-date with CockroachDB releases and best practices:
Use Kubernetes
To orchestrate CockroachDB locally using Kubernetes, either with configuration files or the Helm package manager, see Orchestrate CockroachDB Locally with Minikube.
Use Docker
For CockroachDB v22.2.beta-5 and above, Docker images are multi-platform images that contains binaries for both Intel and ARM. CockroachDB on ARM systems is experimental and is not yet qualified for production use and not eligible for support or uptime SLA commitments. Multi-platform images do not take up additional space on your Docker host.
Docker images for previous releases contain Intel binaries only. Intel binaries can run on ARM systems, but with a significant reduction in performance.
Install Docker for Windows.
Tip: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.
In PowerShell, confirm that the Docker daemon is running in the background:
docker version
If you see an error, 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.
In PowerShell, pull the image for the v22.2.19 release of CockroachDB from Docker Hub:
docker pull cockroachdb/cockroach:v22.2.19
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 PostgreSQL-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: