Building A Cryptocurrency Miner With Raspberry Pi

Building a cryptocurrency miner with raspberry pi

Yes, You Can Mine Cryptocurrency on Your Raspberry Pi

Hello there!

Today, I’m going to show you how to build a Bitcoin full node on the Raspberry Pi. This is a great project for anyone who wants to support the Bitcoin network while validating their own transactions. As the Bitcoin network grows, it’s important that people maintain their full nodes. We need to constantly bring new nodes onto the network to keep it decentralized and healthy.



Setup the Rasfpberry Pi 3
2. Install the External Hard Drive
3. Increase the Swap File
4. Install the Bitcoin Core Dependencies

Step 1: What Is BitCoin?

Install Bitcoin Core
6. Starting the Bitcoin Core Client
7. Download the Blockchain on another Machine (Optional)


What is a Bitcoin Full Node?

A Bitcoin full node is much simpler than it sounds.

Free bitcoin trading ebook

A full node is simply a computer that is running the Bitcoin Core Wallet. The Bitcoin Core Wallet, by default, downloads a full copy of the Blockchain.

Why do you need a full copy of the Blockchain?

Similar to BitTorrent and other peer to peer networks, you have to download the Blockchain from other people.

If you’ve ever downloaded a torrent, you’ll notice that some of them have seeders while other don’t.

How to Mine Monero Crypto Currency on your Raspberry Pi

These “seeders” are people who have already downloaded the file, and have opted to let you download part of the file from them. Without seeders, the BitTorrent network wouldn’t exist.

The Bitcoin network operates the same way.

Building a cryptocurrency miner with raspberry pi

When people try to access their Bitcoin, they are using a wallet that has access to at least part of the network.

If people didn’t have full nodes, we wouldn’t be able to verify transactions or see transactions from the past. You wouldn’t be able to access your Bitcoin because ultimately, without nodes, your Bitcoin wouldn’t exist.

How do you Build a Bitcoin Full Node?

We are going to use a Raspberry Pi 3.

Crypto Mining With a Raspberry Pi? Profitable!

The Raspberry Pi is a small, inexpensive computer, that has just enough specifications to allow us to operate a full node. We are going to download the Blockchain on an external hard drive on a separate machine using the Bitcoin Core Wallet.

After we have downloaded a full copy of the blockchain, we are going to connect the external hard drive to the Raspberry Pi so that it can continue to build it.

It is possible to directly download the blockchain onto the Raspberry Pi, but it will take a lot of time.

Things we are going to Need:


Raspberry Pi 3

The Raspberry Pi is a phenemonal computer.

What makes it so great is that it’s about the size of a credit card and it costs less than $40. The Raspberry Pi can run both Linux and Windows.

For our Bitcoin full node, we are going to use Linux.

Building a cryptocurrency miner with raspberry pi

This is due to the fact that Linux is more lightweight and we are going to need all of the resources that the Raspberry Pi can offer.

Usually Raspberry Pi’s will come barebones. The kit that we purchased comes the Touchscreen, Case, SD Card (which will hold the operating system), and Heatsinks.

LCD Touchscreen

The LCD Touchscreen is an optional component for this project. The Raspberry Pi has a HDMI port built in which can be used to project on any monitor/tv that is HDMI capable.

Cbus super investment options crediting rate

For my full node, I wanted to have a touch screen that displays the current price of Bitcoin.

Plus I plan on sending and receiving Bitcoin directly from my node, and having a designated screen would make this process much easier. Plus it looks cool.

Our kit will use a LCD Touchscreen that is compatible with the Raspberry Pi. It also fits perfectly in the case.

Raspberry Pi Case

The Raspberry Pi case once again is optional.

I wanted something that would contain both my Raspberry Pi and LCD Touchscreen. The kit that I purchased provided one that was simple and lightweight. This is perfect since I want my Raspberry Pi to be simple yet stylish.

Raspberry Pi Wireless Keyboard

This little device is optional, but it makes operating the Raspberry Pi way easier.

Without it, you will have to plug in a desktop USB and Mouse or SSH into the Pi.

I definitely recommend picking it up since its only $20 and it will make your life a lot easier.

1 TB Hard Drive

The 1TB Hard Drive is necessary for storing the Blockchain.

At the time of writing this (08/13/17)  the Bitcoin blockchain is approximately 130GB. You can check the current size by clicking on this link.

Currently, the blockchain is growing at about 50GB a year. As Bitcoin gains popularity in the coming years, it is destined to grow at a much faster rate. For the sake of longevity, I strongly recommend that you purchase a hard drive that will last for years to come.

If a 1TB Hard Drive is too far out of your price range, you can always start smaller and upgrade once you outgrow it.

How to Build a Bitcoin Full Node on a Raspberry Pi


Setting up the Raspberry Pi

Setting up the Raspberry Pi is simple.

Building a cryptocurrency miner with raspberry pi

If you purchased a Raspberry Pi kit that already has Raspbian installed, you simply need to put in the SD card and plug it in.

For those of you that need to install linux on a blank SD card, you can follow this guide on the website.

Update the the Raspbian Software


Install the External Hard Drive

Now that we have Raspbian up and running, we are going to partition the hard and mount it.

First, let’s connect the external hard drive to the usb port on the Raspberry Pi.

After we have connected the external hard drive to the Raspberry Pi we are going to run a command to see if it was identified.

As you can see, the hard drive is showing up at the bottom, and it’s labeled “/dev/sda”.

We are now going to access the drive, format it, and partition it.

How to Build a Bitcoin Full Node on a Raspberry Pi

Just as a warning, anything on the drive is going to be erased after this process. If you have anything important on it, I advise you to transfer off that information before doing this.

Type in the following command.


Now that we are in the drive, you should see this screen.

Enter “d” so that we can delete the partitions that are currently on the hard drive.

Keep entering “d” until you receive a message telling you that there are no more partitions on the hard drive.


Now, it’s time to create our new partition. To do this, type in “n”.


You will be given the options to create a primary partition or an extended partition. Type in “p” to choose primary partition.


You will now be prompted to number the partition.

Choose “1” so that your drive will be named “/dev/sda1”.


For the next two questions about the first and last sector, simply hit enter for both of them so that it chooses the default.

Now that you have created your new partition, it’s time to exit out of “fdisk” Type in “w” to exit fdisk.


Now it’s time tor format your new partition.

We are going to partition it as “Fat 32”.

Why do you need a full copy of the Blockchain?

By partitioning the system as Fat32, we ensure that the hard drive will be compatible with both Windows and Mac. This will come in handy if you decide to download the blockchain using one of those two operating systems.

After the command has finished, you will have a newly partitioned hard drive! Now it’s time to set the drive to automatically mount.

Before we edit the configuration file, let’s create the Bitcoin data directory.

Now it’s time to make modifications to the configuration file.

Use the command below to access the configuration file.

Once we are in this configuration file, we will add this line so that the hard drive is automatically mounted to our “.blockchain” folder.

Forex broker without leverage

Remember to replace “pi” with whatever your Raspberry Pi’s username is.

Hit Ctrl-x and then hit Y so that we can save the file. Now, restart the Raspberry Pi so that we can confirm that the Raspberry Pi is automatically mounting the external hard drive.

Run the command below so that we can see if the drive has be mounted under our folder “.blockchain”.

If you see your drive “/dev/sda1” mounted on “/home/pi/.blockchain” then you are ready to proceed!


Increase the Swap File

A swap file allows the Micro Sd Card in the Raspberry Pi to be used as ram. This step is important if you are going to download the whole blockchain using the Raspberry Pi. If you plan on downloading it on a separate device, this step isn’t necessary.

Let’s start by editing the file “/etc/dphys-swapfile”.

We are going to change the default size of the swap file from 100 to 1000.

Find the line:


Hit CTRL-X and then Y to save the file.

Run the commands below to initiate this new swap file.


Install the Bitcoin Core Dependencies

Before we install the actual Bitcoin Core software, we need to download certain dependencies that the software relies on.

After those dependencies are installed, we are going to need to install git.

Git is going to be used to access download the Bitcoin Core source code from the GitHub repository.

Building a cryptocurrency miner with raspberry pi

In case you don’t know what that is, it’s a commonly accepted platform that distributes source code for all types of applications.

Bitcoin Core uses Berkeley Database for their wallet system.

It specifically relies on version 4.8. Berkeley is created by Oracle, which is the same company that creates Java.

We are going to make a directory that we can download and install the database into.

Now that we are in the new directory that we have created, let’s download the tar for the Berkeley Database.

Now that you’ve downloaded the Berkeley database, you’ll use the following command to extract it.

Now that we have extracted the Berkeley Database, let’s go into the directory prepare the source code for installation.

This process can take anywhere from 5 to 20 minutes.

Once the command has finished, it’s time to install the Berkeley Database.

Excellent! Now that the Berkeley Database is installed, we are now ready to install the Bitcoin Core Client!

5. Insall the Bitcoin Software

The first thing we are going to do is go back into the bin directory.

Use A Raspberry Pi And A CPU Miner To Mine Altcoins

Once we are in the bin directory, we are going to down the Bitcoin Core source code into it.

The “git” command is going to pull the source code from the GitHub repository. Use “-b” to specify to the version/branch of the source code that you want to download.

You can visit: to find out which version of Bitcoin Core is most recent.

Note: This command will download the latest version of Bitcoin Core V.14.

Building a cryptocurrency miner with raspberry pi

You will want to replace the 0.14 with the latest version that is currently out.


Now that we have download the Bitcoin Core source code, it’s time to prepare it for installation.

After you run the “make” command, be prepared to wait a few hours before you are ready to complete the installation.


Bitcoin Core is now ready to be installed. Run the code below to finish the install.

Congratulations! Your Bitcoin Core client is now installed!


Starting the Bitcoin Core Client

Before you start your Bitcoin client, you have to open port 8333 on your router and point it to your Raspberry Pi. This is required so that your new full node can allow incoming connections.

To Start the Bitcoin Core Client, simply type in the command below.

This will start the Bitcoin core client using our mounted hard drive “.blockchain”.

If you followed the section that explained how to mount your external hard drive then it should start downloading directly onto your hard drive.

This process can take a long time since the Raspberry Pi’s resources aren’t that of a full blown desktop.

If you want to speed up this process, go to step 7 and download the Blockchain on another computer.

After you have completely synced your Bitcoin Core Client with the Blockchain, hover your mouse over the little icons at the bottom right of the client. A little display will pop up showing how many connections your client has. If you are showing more connections than 8, you have successfully configured your full node!



Download the Blockchain on a separate Computer (Optional)

To speed of the download of the blockchain, I recommend downloading it on your main machine. You can download Bitcoin Core on Windows, Mac, and Linux.

Building a cryptocurrency miner with raspberry pi

After you download Bitcoin Core, start it up and let the blockchain sync. This can take several days to complete, so make sure that whichever computer you use can withstand being run non-stop during that time.

Downloading the Blockchain on Ubuntu

It is just as simple to download the blockchain on Ubuntu as it is on the Raspbian OS.

Once you have downloaded and installed Ubuntu on your main computer, open terminal.

Installing Bitcoin Core on Ubuntu

This first command will tell Linux where to download the Bitcoin Software. The second will update Linux’s information on which packages are available.

This command will install both the Bitcoin Core command line and the Bitcoin Core GUI interface.

This command will update your Linux Distribution.

Mounting the External Hard Drive to your Ubuntu System

Create a new .blockchain directory

Find out the name of the external hard drive’s partition

Below you can spot out your hard drive usually in this area.

Mount the external hard drive

These two commands will give your user the permissions to access the external hard drive.

Raspberry Pi Lynx Mining Farm

This is necessary for the Bitcoin Core software to access the drive.

Now that we have installed Bitcoin Core and mounted the hard drive, it is time to start the Bitcoin Core Client!

The GUI for Bitcoin Core should open following this command. It will show you a screen that has details regarding how many more blocks need to be downloaded, how long it will take, what time period of the blockchain you are downloading (This part is cool, it’s kind of like going back in time).

After the blockchain has completely downloaded, let’s unmount it and then mount it on the Raspberry Pi.

sudo umount /dev/sda1

Unplug the external hard drive from your main machine and then plug it into the Raspberry Pi.

Restart or turn on your Raspberry Pi, and run the Bitcoin Core Client.

After the Bitcoin Core Client starts up, check if the blockchain is fully downloaded by hovering your cursor over the checkmark at the bottom right of the client.

In Conclusion

Building a Bitcoin full node on a Raspberry Pi is much simpler than it seems.

After you purchase all of the parts, it’s simply a matter of running the necessary commands and opening the port 8333 on your router.

A full node isn’t necessary to send and receive Bitcoin, but it’s necessary to keep the network healthy. By allowing incoming transactions to your node you are verifying transactions and allowing the blockchain to be downloaded.

What makes Bitcoin so special is it’s ability to be maintained by the people who use it.

Let’s continue to keep Bitcoin alive and well by doing all that we can to let out voice be heard throughout the Bitcoin network.

If you have any questions or contributions to this guide, I’d love for you to either comment below or email me at [email protected]!