Skip to content

Bitcoin Core Setup on Ubuntu

Dan Janosik edited this page Apr 6, 2021 · 3 revisions

Ubuntu Server 20.04

Bitcoin Version: 0.20.1

apt update
apt upgrade

Mount a data drive?

# list disks
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

# if you need to partition disk:
mkfs -t ext4 /dev/sdx

# make dir for disk to mount to
mkdir -p /mnt/diskx

# mount it
mount /dev/sdx /mnt/diskx

Install tor proxy (source for installation instructions). Bitcoin Core tor docs

apt install tor nyx
# Note: nyx is a tor monitoring utility

which tor
# /usr/sbin/tor

tor --version
# Tor version 0.4.2.7.

service tor start
# Tor proxy starts on 9050

Not shown here but may be desired: set tor admin password

adduser bitcoin
cd /home/bitcoin
wget https://bitcoin.org/bin/bitcoin-core-0.21.0/bitcoin-0.21.0-x86_64-linux-gnu.tar.gz
tar xzfv bitcoin-0.21.0-x86_64-linux-gnu.tar.gz
rm ./*.gz
chown -R bitcoin:bitcoin /home/bitcoin/bitcoin-0.21.0/
mkdir /etc/bitcoin
wget https://raw.githubusercontent.com/janoside/bitcoin-resources/master/files/bitcoin.conf
mv bitcoin.conf /etc/bitcoin/

Edit config as needed

vim /etc/bitcoin/bitcoin.conf

Permissions

chown -R bitcoin:bitcoin /etc/bitcoin
ln -s /home/bitcoin/bitcoin-0.20.1/bin/bitcoind /usr/bin/
mkdir /mnt/data/bitcoin
chown -R bitcoin:bitcoin /mnt/data/bitcoin

Start up

bitcoind -daemon -conf=/etc/bitcoin/bitcoin.conf