Installing Bitcoin Core from Source: A Beginner’s Journey

 

 

Installing Bitcoin Core for the first time isn’t as easy as one would expect.

For developers following the Bitcoin development pathway, running a Bitcoin Core node is an important part of getting hands-on experience. It allows you to move beyond reading about Bitcoin and actually interact with the network, create wallets, generate transactions, inspect blocks, and experiment with Bitcoin Core through the command line.

But getting to that point was not straightforward for me.

My First Attempt

I first encountered Bitcoin Core installation during the Mastering Bitcoin Cohort 1 pathway program at Dada Devs, where I was a student learning the fundamentals of Bitcoin development. Installing Bitcoin Core was one of the practical requirements, but getting it up and running turned out to be quite a challenge for me.

I remember struggling to follow the installation instructions in Mastering Bitcoin. I reread the installation chapter about three times, but I still couldn’t get everything working.

I reached out to some of my peers, especially those who had mentioned during our sessions that they had successfully installed Bitcoin Core.

At the time, I was using Windows. Since most of the people I asked had followed a Linux-based workflow, I was advised to use Windows Subsystem for Linux (WSL) so that I could work within a Linux environment. 

That turned out to be an important step for me.

Setting Up WSL

WSL allowed me to run a Linux environment directly on my Windows machine without having to replace Windows with Linux.

Once I had WSL installed, I could follow the Linux build instructions for Bitcoin Core.

But there was another challenge: downloading the required dependencies and source code required a reliable internet connection.

I switched from my home Wi-Fi to my personal mobile data because I didn’t want an interrupted connection to leave me halfway through the setup.

Eventually, I got everything downloaded and moved on to building Bitcoin Core.

Building Bitcoin Core from Source

This was where things became more interesting.

After installing the required dependencies, I created a build directory and started compiling Bitcoin Core.

A simplified version of the build process looks like this:

cmake -B build

cmake –build build

 

The first time I built Bitcoin Core, the process took quite a while.

While waiting, I decided to stop relying entirely on the instructions I had been following and went directly to the Bitcoin Core repository and its documentation.

That was probably one of the most important moments of the whole process.

I discovered that the build documentation clearly explained the different steps, dependencies, build options, and some of the common problems developers might encounter.

I also came across the -j option for parallel compilation.

Instead of building everything one job at a time, I could use multiple CPU cores simultaneously:

cmake –build build -j$(nproc)

 

Here, $(nproc) determines the number of available CPU cores, while -j tells the build system how many jobs it can run in parallel.

The difference was significant.

What had previously felt like a painfully long process became much faster.

More importantly, I learned something that had nothing to do with the command itself:

Read the documentation of the software you are working with.

I had spent a lot of time asking an LLM what the next step should be, while the official documentation already contained the information I needed.

I honestly felt a little embarrassed that I hadn’t started there.

But that was also one of the biggest lessons from the experience.

Finally Running Bitcoin Core

After successfully compiling Bitcoin Core, I had the binaries available in the build directory.

I could now start a Bitcoin Core node and interact with it through the command line.

For example, when working with a regtest node:

./build/bin/bitcoind -regtest -daemon

 

The -regtest option starts Bitcoin Core in regression test mode.

Regtest is particularly useful for developers because it gives you a private Bitcoin blockchain that you control. You can generate blocks whenever you want, create wallets, send transactions, and experiment without using real Bitcoin or waiting for the public network.

Once the node was running, I could communicate with it using bitcoin-cli.

For example:

./build/bin/bitcoin-cli -regtest getblockchaininfo

 

This returns information about the current state of the regtest blockchain.

And if I wanted to see the available commands, I could use:

./build/bin/bitcoin-cli -help

 

This was the point where the installation stopped feeling like the goal and started feeling like the beginning.

 

What I Did with bitcoin-cli

Once Bitcoin Core was running, I went back to Mastering Bitcoin and started experimenting with the commands.

Instead of simply reading about how Bitcoin works, I could now actually interact with a Bitcoin node.

Some of the things I experimented with included:

  • Checking blockchain information
  • Creating and managing wallets
  • Mining blocks in regtest
  • Generating addresses
  • Sending transactions between wallets
  • Inspecting transactions
  • Decoding raw transactions
  • Checking whether transactions were in the mempool
  • Exploring different Bitcoin Core RPC commands

For example, I could generate blocks on my private regtest blockchain and then inspect the resulting blockchain state.

I could also use commands such as:

./build/bin/bitcoin-cli -regtest getmempoolinfo

 

to inspect the mempool.

And after creating a transaction, I could use Bitcoin Core’s transaction-related RPC commands to inspect and decode it.

This hands-on interaction helped me understand concepts that had previously felt very abstract when I encountered them only in the book.