Bitcoin Blockchain on NAS processed by Raspberry Pi

If you, like me, don't want to have a Bitcoin Wallet with the not-so-small blockchain running on your workstation or laptop all the time - but then you have a Rpi hardly ever used and a NAS with plenty of room - this might be the solution you are looking for:

Start by downloading Raspbian Jessie Lite from and write the image to an SD-card of at least 4GB.

There's no need for monitor, keyboard and mouse for this as long as you have a LAN - just insert the SD-card into the Raspberry Pi, connect it to your network and powersupply. You'll then have to detect it with software or perhaps you can find the IP-address to it from your router like I did.

Connect to the Raspberry Pi by SSH (for example with Putty for Windows)

Username: pi
Password: raspberrypi

sudo raspi-config

Expand Filesystem, Change User Password, Boot Options (no GUI), Wait for Network at Boot, Advanced Options|Memory Split (waste minimum for GPU)

Depending on what sort of NAS you are using, you'll have to log in with admin access to alter the folder shares and enable NFS.

Under Control Panel | Shared Folder, create a shared folder to store the blockchain. You can call it whatever you like, but it must have admin read/write privileges. Under the NFS Permissions tab, create a new rule. Set the hostname to the LAN IP of your Bitcoin node, set the privilege to "Read/Write", set the squash to "Map all users to admin" and set the security to "sys". You may need to check the "Allow connections from non-privileged ports" and "Allow users to access mounted folders" or similar.

Back in the RPi (might have to do this on every boot or make a script):
sudo update-rc.d rpcbind enable

sudo update-rc.d nfs-common enable

sudo service rpcbind restart

sudo mount NAS_IP:/bitcoin /bitcoinData

Increase the swapfile to allow painless compilation and later running of Bitcoin Core on the RPi:
sudo nano /etc/dphys-swapfile

Increase the size to 1000:

Save and run the following to allow the system to upgrade and restart:
sudo dphys-swapfile setup

sudo dphys-swapfile swapon

sudo sysctl -w vm.swappiness=1

The last command will not be permanent unless you add it in the sysctl.conf file, but we need it only for speeding up the build processes and later we're better off without as it will wear on the flash drive.

Install necessary packages:
sudo apt-get install autoconf libtool libssl-dev libboost-all-dev libminiupnpc-dev -y

sudo apt-get install qt4-dev-tools libprotobuf-dev protobuf-compiler libqrencode-dev -y

sudo apt-get install libevent-dev

sudo apt-get install git-core

Create a directory and install the Berkeley database in it. (if you just want to blockchain and no wallet, you can skip this)

mkdir ~/bin

cd ~/bin


tar -xzvf db-4.8.30.NC.tar.gz

cd db-4.8.30.NC/build_unix/

../dist/configure --enable-cxx

make -j4

sudo make install

This will take a long time. If you run into trouble, it might help to simply run make, omitting -j4, at the cost of some extra time. Another thing that might help is to install (and use) Screen to avoid unplanned disconnects from the terminal/Putty:
sudo apt-get install screen

Now, to install Bitcoin Core:
cd ~/bin

git clone -b v0.12.1

Replace v0.12.1 with whatever release that is official when you do this, or remove -b v0.12.1 all together if you're happy to go with release candidates as well.

cd bitcoin/


./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --enable-upnp-default

Drop the Berkeley part and add --disable-wallet if you don't want the wallet.

You might want to use Screen before running the next command:

make -j2

sudo make install

If you run into trouble, it might help to simply run make, omitting -j2, at the cost of some time, again.

Move into the NAS-shared folder and create the bitcoin.conf file there. If you have an existing blockchain, wallet.dat and config you might advance a few weeks (perhaps even months) in download time by doing this.

create rpcuser and rpcpassword in the config file.

cd ~/bitcoinData

nano bitcoin.conf

rpcpassword=[long secret key]

Launch the bitcoind service by
bitcoind -datadir=/home/pi/bitcoinData -daemon


  • Running a node with the database on a remote-mounted NAS? (Reddit)
  • Build Your Own Raspberry Pi Bitcoin Full Node [Bitcoin Core] (Raspnode)
  • Using Screen with Raspberry Pi to avoid leaving SSH sessions open (
Author image
About Kent