Build Bitcoin node in Linux (Debian)/Ubuntu

Bitcoin node in Linux (Debian)/Ubuntu | If you want to clone Bitcoin and make your own network, the process is similar but some changes in code level. Feel free to knock me for that.


  1. Install Build requirements

Install following dependencies: 

$ sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3sudo apt-get install libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev

Optional (see –with-miniupnpc and –enable-upnp-default):

    $ sudo apt-get install libminiupnpc-dev

ZMQ dependencies (provides ZMQ API):

    $ sudo apt-get install libzmq3-dev

Build Qt 5:

$ sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler

libqrencode (optional) can be installed with:

$ sudo apt-get install libqrencode-dev
  1.  Clone bitcoin
$ git clone https://github.com/bitcoin/bitcoin
  1. Install BerkeleyDB

 BerkeleyDB is required for the wallet. Ubuntu and Debian have their own libdb-dev and libdb++-dev packages, but these will install BerkeleyDB 5.1 or later. This will break binary wallet compatibility with the distributed executables, which are based on BerkeleyDB 4.8. 

We recommend, installing Berkeley DB from the script of bitcoin.

Enter your local copy of the bitcoin repo. Once you are at the root of your bitcoin, run the installation command:

$ cd bitcoin
$ ./contrib/install_db4.sh `pwd`

Once Berkeley DB is done downloading and installation, you will get instruction to export Berkeley DB

 and configure bitcoin as fellows. The path will be different as per your machine. You have to run those command as it is.

export BDB_PREFIX=’<PATH-TO>/db4′

./configure BDB_LIBS=”-L${BDB_PREFIX}/lib -ldb_cxx-4.8″ BDB_CFLAGS=”-I${BDB_PREFIX}/include”

Now copy the above command and export the Berkeley DB.

$ export BDB_PREFIX=’<PATH-TO>/db4′
  1. Compile bitcoin Core
$ cd bitcoin
$ ./autogen.sh//copy the configuration command from step 3 and run $./configure BDB_LIBS=”-L${BDB_PREFIX}/lib -ldb_cxx-4.8″ BDB_CFLAGS=”-I${BDB_PREFIX}/include”$ make
$ sudo make install
  1. Execute bitcoin Core
$ bitcoind -txindex -daemon