This guide explains how to build Bitcoin Core on Linux and Unix systems. For BSD-specific instructions, see the BSD build guide.
Basic Build Process
Configure the build
Run CMake to configure the build system:To see all available configuration options: Build and install
Compile Bitcoin Core and optionally install it:cmake --build build # Append "-j N" for N parallel jobs
cmake --install build # Optional
Memory Requirements
C++ compilers are memory-hungry. It is recommended to have at least 1.5 GB of memory available when compiling Bitcoin Core.
On systems with less memory, compilation may fail or be extremely slow. Consider using the memory optimization options below.
Low Memory Optimization
If you have limited memory, you can tune GCC to conserve memory:
cmake -B build -DCMAKE_CXX_FLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768"
You can also skip debugging information:
cmake -B build -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -g0"
Alternatively, use Clang instead of GCC (often less resource-hungry):
cmake -B build -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
Distribution-Specific Instructions
Ubuntu & Debian
Install build requirements
Install the base build tools:sudo apt-get install build-essential cmake pkgconf python3
For Debian “oldstable” or earlier Ubuntu LTS releases, you may need to install a newer compiler according to the dependencies documentation. Install required dependencies
Install the core dependencies:sudo apt-get install libevent-dev libboost-dev
Install wallet dependencies (optional)
SQLite is required for wallet functionality:sudo apt install libsqlite3-dev
To build without wallet support, use -DENABLE_WALLET=OFF during configuration. Install IPC dependencies (optional)
Cap’n Proto is needed for IPC functionality:sudo apt-get install libcapnp-dev capnproto
To build without IPC, use -DENABLE_IPC=OFF during configuration. Install ZMQ dependencies (optional)
For ZMQ notification support:sudo apt-get install libzmq3-dev
Enable with -DWITH_ZMQ=ON during configuration. Install USDT dependencies (optional)
For User-Space Statically Defined Tracing:sudo apt install systemtap-sdt-dev
Install GUI dependencies (optional)
For the Qt-based GUI:sudo apt-get install qt6-base-dev qt6-tools-dev qt6-l10n-tools qt6-tools-dev-tools libgl-dev
For Wayland support:sudo apt install qt6-wayland
For QR code support in the GUI:sudo apt-get install libqrencode-dev
Enable the GUI with -DBUILD_GUI=ON during configuration.
Fedora
Install build requirements
sudo dnf install gcc-c++ cmake make python3
Install required dependencies
sudo dnf install libevent-devel boost-devel
Install wallet dependencies (optional)
sudo dnf install sqlite-devel
Install IPC dependencies (optional)
sudo dnf install capnproto capnproto-devel
Install ZMQ dependencies (optional)
sudo dnf install zeromq-devel
Install USDT dependencies (optional)
sudo dnf install systemtap-sdt-devel
Install GUI dependencies (optional)
For Qt GUI:sudo dnf install qt6-qtbase-devel qt6-qttools-devel
For Wayland support:sudo dnf install qt6-qtwayland
For QR codes:sudo dnf install qrencode-devel
Alpine
Install build requirements
apk add build-base cmake linux-headers pkgconf python3
Install required dependencies
apk add libevent-dev boost-dev
Install wallet dependencies (optional)
Install IPC dependencies (optional)
apk add capnproto capnproto-dev
Install ZMQ dependencies (optional)
Install GUI dependencies (optional)
apk add qt6-qtbase-dev qt6-qttools-dev
For QR codes:
User-Space Statically Defined Tracing (USDT) is not supported or tested on Alpine Linux.
Example: Arch Linux Build
This example shows the complete process to build Bitcoin Core on Arch Linux:
Install dependencies
pacman --sync --needed capnproto cmake boost gcc git libevent make python sqlite
Clone the repository
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin/
Configure and build
cmake -B build
cmake --build build
Run Bitcoin Core
./build/bin/bitcoind
./build/bin/bitcoin help
Disable-Wallet Mode
When the intention is to only run a P2P node without a wallet, Bitcoin Core can be compiled in disable-wallet mode:
cmake -B build -DENABLE_WALLET=OFF
In this case there is no dependency on SQLite. Mining is also possible in disable-wallet mode using the getblocktemplate RPC call.
Alternative: Self-Compiled Dependencies
Instead of using your distribution’s packages, you can self-compile all dependencies using the depends system. See dependencies.md for more information.