You probably already asked yourself about mining with your Raspberry Pi.
Now that Bitcoin becomes really hard to mine, Monero is the new Bitcoin
In this tutorial you’ll learn how to mine Monero on Raspberry Pi.
How to mine the Monero cryptocurrency on your Raspberry Pi?
Mining Monero on Raspberry Pi is easy when you have the good tools.
You can download and install a miner for free, to start mining a few minutes later.
You also need an account on a mining pool to do this (I’ll show you how).
So, let’s start learning a little more about this topic.
I’ll start with a short introduction about cryptocurrencies, Monero and mining pool.
Then we’ll see how to install a miner on your Raspberry Pi.
And finally, we’ll talk a little about profitability when mining on Raspberry Pi.
What is Monero?
Crypto currencies reminder
A cryptocurrency is a decentralized digital currency.
This means that it’s not managed by banks and states.
It’s a recent concept. The first one was Bitcoin in 2009.
As it is decentralized, it allows anyone to be a part of the chain.
By being a part of the network, you lend your device resources to the community to help the network.
And the system can reward you, it’s what we call a miner.
The more resources you have, the more cryptocurrency you’ll get.
Monero is one of these cryptocurrencies, created in 2014.
I choose Monero for this tutorial, rather than Bitcoin because it’s easier to get something.
In the Bitcoin network, there are big miners, and most of the time you can’t get anything with a standard computer.
So, with a Raspberry Pi it’s even worse …
The advantage of Monero is that normal people with a classic CPU can help to get rewards.
Just a few words about the mining pool as we’ll use it later.
A mining pool is simply a network of miners.
When a block is found in a pool, all miners get rewarded depending on how they helped the entire network achieving this.
How to install a miner on your Raspberry Pi
Now that the vocabulary is clear, we can move on to the installation process.
Create a Minergate account
The first thing you need to do is to get access to a mining pool.
What I recommend is to create an account on MinerGate.
It’s simple, and you can use it anywhere, not only on Raspberry Pi.
- Go to the MinerGate registration form.
- Fill the form.
- Confirm your email and log into your account.
- On the Dashboard, you can check which currency you are currently mining and your winnings.
We’ll check that later.
- In the main menu, click on Mining Pools > Monero.
- Scroll down the page to the mining pool information:
- Keep this information safe, you’ll need it later.
If you already have Raspbian on your Raspberry Pi, you can move to the next paragraph.
If not, you can check my post on how to install Raspbian and come back here later.
Once you have Raspbian installed, Internet configured and SSH enabled, you can move to the miner installation.
Install the Monero miner
To mine Monero, we’ll use the cpuminer-multi tool from Tanguy Pruvot
You can check the GitHub project here.
Follow these steps to install it on your Raspberry Pi:
- I recommend connecting to the Raspberry Pi via SSH.
So you can just copy/paste commands from this page.
- Update your system:
sudo apt update
sudo apt upgrade
- Install all needed dependencies:
sudo apt install git automake autoconf libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev
- Go into the folder you want to install in and run these commands:
sudo git clone https://github.com/tpruvot/cpuminer-multi
- You can do the compilation and installation with:
sudo ./autogen.shIt can take some time on Raspberry Pi.
After this, your miner is ready to use.
The executable name is “cpuminer”.
I give you the entire command here:
./cpuminer -a cryptonight -o stratum+tcp://xmr.pool.minergate.com:45700 -u YOUR_EMAIL
Replace YOUR_EMAIL by the email address you use as a login on MinerGate
Your password is not required.
A few seconds later, the mining process starts:
If you go back to the MinerGate dashboard, you can see the miner online.
That’s it, you’re mining on your Raspberry Pi!
Thoughts about mining on Raspberry Pi
After this little excitement, let’s get back to reality.
In this profit calculator, we can convert H/s into profit estimation.
Even if I remove the electricity cost, with a 2H/s ratio, you’ll not earn anything on Raspberry Pi 3B+.
This simulation shows us a $0.27 gain after one year.
If you consider the $35 of the Raspberry Pi (minimum), and the electricity cost (probably around $0.10 a week), you’ll lose money by mining Monero on your Raspberry Pi.
And even if you can get a free Raspberry Pi and free electricity, this is not a good deal.
Raspberry Pi 4 has more hashing power (about 12H/s), but still not enough to make you rich 🙂
Even if it’s not profitable, you can learn many things by installing a miner on your Raspberry Pi.
As it doesn’t cost a lot, and the installation is rather easy, it’s a good way to make a first step in the cryptocurrencies world.
You can now try it on bigger devices and win a little with crypt currencies 🙂
My Raspberry Pi is heating when mining, what can I do? The mining process take all the power of your CPU, so it’s normal to see that kind of thing. If you want to avoid this, you can mine with less CPU, by adding the -t option to the cpuminer command (“-t 2” for example, t stands for threads).
How to use MinerGate on other platforms? Create an account on MinerGate, then click on “Downloads” in the main menu. Choose the download file corresponding to your computer operating system (Windows/Mac/Ubuntu) and GPU, then install it. You’ll get a better rate on your computer, here is an example on my laptop:
That’s it, you now know how to mine a cryptocurrency (Monero here) with your Raspberry Pi, and on any Linux system.
I’m not an expert in cryptocurrency, so if you see some mistakes or have other suggestions for readers to enjoy this post, please share in the comments below.