DEV Community

Cover image for Comprehensive Guide: Installing Bitcoin Core on Windows for Beginners
Oluwatobi Jolayemi
Oluwatobi Jolayemi

Posted on

Comprehensive Guide: Installing Bitcoin Core on Windows for Beginners

Learn the Easy Steps to Set Up Your Bitcoin Core on Windows and Bitcoin Development Confidently.

Configuring Bitcoin Core on your Windows computer might seem challenging, especially for those new to Bitcoin development. For those unfamiliar with Bitcoin Core, it serves as a client for the Bitcoin protocol and is widely recognized as the reference implementation for a Bitcoin client.

In this article, I will simplify the process of setting up Bitcoin Core, outlining the steps involved. I trust you will find it informative.

Learning Outcomes

  1. You should be able to install Bitcoin Core on your Windows Computer.

  2. You should be able to have an understanding of each command you are running.

  3. You should able to configure your node to run on regtest.

  4. You should be able to run basic bitcoin-cli commands

Requirements

I assume you have a computer running the Windows operating system enabled for virtualization. In this tutorial, I'm working with a Windows 11 OS, featuring 16 gigabytes of RAM and a 500-gigabyte hard disk. It's important to mention that running Bitcoin Core on a less powerful PC is still possible.

Before proceeding, we'll establish a Linux environment on our PC using WSL, enabling us to execute Linux-like commands in the terminal.

Setting Up Environment

There are two installations we have to do in this phase: WSL and Ubuntu.

WSL which stands for Windows Subsystem for Linux allows developers harness the capabilities of both Windows and Linux on the same PC. By having WSL installed on your PC, you can replicate all the sweet spots of Linux without committing your system exclusively to the operating system.

Go to your PowerShell terminal and type the installation command

wsl --install
Enter fullscreen mode Exit fullscreen mode

Once the installation is complete, restart your PC to activate the changes.

After your PC has fully restarted, proceed to install a Linux distribution. A Linux distro refers to the distribution for Linux, and there are various options such as Ubuntu, Kali, Mint, Red Hat, and more. In this guide, I am utilizing an Ubuntu distro, which I installed directly from the Microsoft Store.

Linux Distros on Microsoft Store

Dependencies

To successfully compile and run Bitcoin-Core on your PC, there are libraries you need to install within your linux environment. Navigate to your Linux terminal and type the following command:

sudo apt-get update
Enter fullscreen mode Exit fullscreen mode

This command installs all the latest package information available for the packages currently installed on the system. This is to ensure that the currently installed libraries are not outdated.

Then, you need git installed to enable you clone the bitcoin core repository from its remote source.

sudo apt-get install git
Enter fullscreen mode Exit fullscreen mode

Then run the following command

sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 libevent-dev
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev
sudo apt-get install libsqlite3-dev
sudo apt-get install libminiupnpc-dev
sudo apt-get install libzmq3-dev
sudo apt-get install libqrencode-dev
Enter fullscreen mode Exit fullscreen mode

Installing Bitcoin Core

Now that the environment setup is complete, it's time to clone the Bitcoin Core repository. Navigate to your linux terminal and input the following command:

 git clone https://github.com/bitcoin/bitcoin.git
Enter fullscreen mode Exit fullscreen mode

Terminal showing git cloning the bitcoin project locally

When you are done cloning the repo, go into the directory by running the command below.

cd bitcoin
Enter fullscreen mode Exit fullscreen mode

Then, you will need to check the suitable version to install by running the following git command for that.

git tag
Enter fullscreen mode Exit fullscreen mode
leonardra@DESKTOP-6OA1ID2:~/bitcoin$ git tag
noversion
v0.1.5
v0.1.6test1
v0.10.0
v0.10.0rc1
v0.10.0rc2
v0.10.0rc3
v0.10.0rc4
v0.10.1
v0.10.1rc1
v0.10.1
v0.10.1rc1
v0.10.1rc2
...
// To the latest version
Enter fullscreen mode Exit fullscreen mode

You get an output of all the bitcoin-core versions. To navigate, you use the Up and Down arrow key.

To select a version, escape from the tag page then type this

git checkout v24.0
Enter fullscreen mode Exit fullscreen mode

This command switches into the v24.0 branch from the master branch, ultimately making it the active version of the software you'll be working on. To verify that you are indeed in the correct version, execute the following command.

git status
Enter fullscreen mode Exit fullscreen mode

Result of

Within the bitcoin directory, copy and paste the following command to download Berkeley DB, a critical dependency need for the software to compile.

./contrib/install_db4.sh `pwd`
Enter fullscreen mode Exit fullscreen mode

Once Berkeley DB is installed, execute the following command while still in the bitcoin directory

./autogen.sh
Enter fullscreen mode Exit fullscreen mode

Autogen.sh is a script that generates the necessary files needed in the project for compilation and installation.

After this you run the ./configure script.

./configure
Enter fullscreen mode Exit fullscreen mode

The ./configure script is used to configure the files generated by the autogen script and most importantly generates the Makefile which is necessary in the next step.

The next step is to compile the software using the make command. This process takes a little bit of time and utilizes a considerable amount of resources depending on the available resources you have on your PC.

make

# optional: to make the process share resources across your 
# CPU cores, you can run this
# n is the number of cores you want to utilize in parallel
make -j n
Enter fullscreen mode Exit fullscreen mode

After it is done compiling, run the make install command to complete the installation process. This process creates the .bitcoin directory in your home directory. It also installs the bitcoind and bitcoin-cli on your computer

make install
Enter fullscreen mode Exit fullscreen mode

Post - Installation

Now you are done with the installation, which means you have the bitcoind and bitcoin-cli installed on you computer.

Bitcoind is the bitcoin daemon that runs and enables you connect to the bitcoin network.

Bitcoin-Cli is an utility that comes with the bitcoin software and allows you communicate with the software through the terminal.

While you are eager to jump right into creating wallets and sending bitcoins, it is essential to configure the network you want your node to run on. I will be running on regtest for the purpose of this guide.

You can do this by updating your bitcoin.conf file, a file generated during your installation and located within the .bitcoin directory.

From your home directory copy and paste the command below

cd .bitcoin
Enter fullscreen mode Exit fullscreen mode

Then run the follwoing command

nano bitcoin.conf
Enter fullscreen mode Exit fullscreen mode

This command loads an interface for you to place your config. There is an online config generator I used. You can get it here. Copy and paste the following

# Generated by https://jlopp.github.io/bitcoin-core-config-generator/

# This config should be placed in following path:
# ~/.bitcoin/bitcoin.conf

# [chain]
# Regression Test Network
chain=regtest
# Run this node on its own independent test network. Equivalent to -chain=regtest
regtest=1

# [debug]
# Enable debug logging for all categories.
debug=1
# Send trace/debug info to console instead of debug.log.
printtoconsole=1
daemon=0

# Options only for mainnet
[main]

# Options only for testnet
[test]

# Options only for regtest
[regtest]
Enter fullscreen mode Exit fullscreen mode

Save file and exit. The above configuration set your node to run on regtest.

Running Your First Bitcoin-Cli Command

You finally got to the last stage! You have painstakingly installed the Bitcoin software, it's time to play around with bitcoin-cli command.

To interact with the bitcoin network, you have to start the bitcoin daemon. Run this command.

bitcoind
Enter fullscreen mode Exit fullscreen mode

Bitcoin Daemon logs

You see the logs appear similar to the above image. This shows that the daemon is currently running and is ready to receive command.

Now let us check information about the network our node is running on.

bitcoin-cli getnetworkinfo
Enter fullscreen mode Exit fullscreen mode

For more a detailed documentation on all the commands made available by the bitcoin-cli, check here and this.


If you got here, you can finally consider yourself a bitcoin developer and ready to hack your way around the software. The potential for what you can achieve is vast, and this marks only the beginning. Don't hesitate to follow me so you get firsthand notification of my next article.


References

  1. https://github.com/bitcoin/bitcoin.git

  2. What is the job of autogen.sh whenbuilding a c++ package on Linux

  3. https://learn.microsoft.com/en-us/windows/wsl/install

  4. https://jlopp.github.io/bitcoin-core-config-generator/

  5. https://chainquery.com/bitcoin-cli

Top comments (1)

Collapse
 
foma4tune profile image
Foma Ovolevor

This is a useful guide. Thanks for the effort to re-publish it here.