Skip to main content
This guide explains how to build Bitcoin Core for Windows.

Build Options

The following options are known to work for building Bitcoin Core on Windows: Other options which may work but have not been extensively tested:
  • On Windows, using a POSIX compatibility layer such as cygwin or msys2
The instructions below work on Ubuntu and Debian. Make sure the distribution’s g++-mingw-w64-x86-64-posix package meets the minimum required g++ version specified in dependencies.md.

Installing Windows Subsystem for Linux

If you’re building on Windows, first install WSL by following the upstream installation instructions: WSL Installation Guide

Cross-Compilation for Ubuntu and WSL

The steps below can be performed on Ubuntu or WSL. The depends system will also work on other Linux distributions, however the commands for installing the toolchain will be different.
1

Install NSIS (optional)

If you want to build the Windows installer using the deploy build target, install NSIS:
apt install nsis
2

Clone the repository

Acquire the source in the usual way:
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
For WSL, the Bitcoin Core source path MUST be somewhere in the default mount file system (e.g., /usr/src/bitcoin), and NOT under /mnt/d/. If this is not the case, the dependency autoconf scripts will fail.This means you cannot use a directory located directly on the host Windows file system to perform the build.
3

Build using the depends system

Build the dependencies and configure the build:
gmake -C depends HOST=x86_64-w64-mingw32  # Append "-j N" for N parallel jobs
cmake -B build --toolchain depends/x86_64-w64-mingw32/toolchain.cmake
To see all available configuration options:
cmake -B build -LH
4

Compile Bitcoin Core

cmake --build build     # Append "-j N" for N parallel jobs

Depends System

For further documentation on the depends system, see README.md in the depends/ directory of the source code and the dependencies documentation.

Installation

After building using the Windows subsystem, it can be useful to copy the compiled executables to a directory on the Windows drive in the same directory structure as they appear in the release .zip archive.

Standard Installation

This will install to c:\workspace\bitcoin, for example:
cmake --install build --prefix /mnt/c/workspace/bitcoin
Due to the presence of debug information, the binaries may be very large.

Installation Without Debug Symbols

If you do not need debug information, you can prune it during install:
cmake --install build --prefix /mnt/c/workspace/bitcoin --strip

Creating an Installer

You can also create a Windows installer:
cmake --build build --target deploy
This requires NSIS to be installed (see Step 1 above).