A Complete Beginners Guide to Installing a Bitcoin Full Node on Linux (2021 Edition)

Compile Bitcoin on Kubuntu 20.4 Without Linux Experience

Preface

Primary:

Standalone:

Table Of Contents

Introduction

Part 0 — For Those Who Just Want The Commands

Update The OS:

Install Git:

Make And Move To The Install Directory:

Clone The Bitcoin repository:

cd ~/codegit clone https://github.com/bitcoin/bitcoin.git

Install libraries:

sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 libevent-devsudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-devsudo apt-get install libsqlite3-devsudo apt-get install libminiupnpc-devsudo apt-get install libzmq3-devsudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-toolssudo apt-get install libqrencode-dev

Install the Berkeley DB:

cd ~/code/bitcoin./contrib/install_db4.sh `pwd`

Prepare for installing Bitcoin:

cd ~/code/bitcoingit checkout tags/v0.21.1./autogen.sh

Replace /satoshi/ with your username:

export BDB_PREFIX='/home/satoshi/code/bitcoin/db4'

More preparation:

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

Compile & Install Bitcoin:

makesudo make install

Start Bitcoin:

Part 1— Setting Up

Download Kubuntu ISO image

Install ISO image to USB or CD

Install the Operating System

Log In And Get Acquainted

Part 2— Prerequisites & Dependencies

Updating Linux

satoshi@nakamoto:~$ sudo apt-get update

Installing Git

satoshi@nakamoto:~$ sudo apt-get install git

Cloning The Bitcoin Core Repository

satoshi@nakamoto:~$ mkdir -p ~/code && cd ~/code
satoshi@nakamoto:/home/satoshi/code$
$ git clone https://github.com/bitcoin/bitcoin.git
$ ls
$ ls bitcoin
The output from the terminal matches the files shown in the file manager. One is text, the other is graphical.

Installing Libraries

$ 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 libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools$ sudo apt-get install libqrencode-dev

Installing The Berkeley Database

$ cd ~/code/bitcoin$ ./contrib/install_db4.sh `pwd`
Video cuts off after 60 seconds.

Part 3— Compiling Bitcoin Core 0.21.1

$ cd ~/code/bitcoin$ git checkout tags/v0.21.1$ ./autogen.sh
This video was recorded before Bitcoin Core v0.21.1 was released.

Pay attention to this step.

$ export BDB_PREFIX='/home/satoshi/code/bitcoin/db4'
$ ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include"
$ make$ sudo make install

Part 4— Configuring And Familiarizing Yourself With Your New Node

Launching The Bitcoin Core GUI And Viewing Logs

$ mkdir ~/.bitcoin$ cd ~/.bitcoin
$ touch ~/.bitcoin/debug.log
$ tail -f ~/.bitcoin/debug.log
$ bitcoin-qt

Launching Bitcoin In The Terminal

$ bitcoind

Creating The bitcoin.conf File

# Needed for full validation
assumevalid=0
# Improves LND performance
# Needs to be set now if you're going to install Lightning later
txindex=1
# Not needed, but will show us useful info later in the tutorial
debug=net
assumevalid=0
txindex=1
debug=net
#(Example config)debug=net
prune=10000
#(Example config)debug=net
prune=10000
maxmempool=100
#(Example config)debug=net
assumevalid=0
$ tail -f ~/.bitcoin/debug.log | grep "UpdateTip:"
$ bitcoin-qt &
$ tail -f ~/.bitcoin/debug.log | grep -v "UpdateTip:\|Requesting block\|sending getdata\|received block\|received: block"

One final thing that is specific to laptops:

$ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target$ systemctl restart systemd-logind.service
$ sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

Extra Guidance

How To Create A Transaction Index

$ bitcoind -reindex
$ bitcoind

How To Recompile/Update Bitcoin Core

$ bitcoind --version

Information Aggregator