DEV Community

Grant McNamara
Grant McNamara

Posted on • Updated on

How To Mine XMR on a Raspberry PI

See the article on my site: https://cryptoandpi.netlify.app/how-to-mine-monero-on-your-raspberry-pi
Happen to own raspberry pi and you would like to mine monero on it? This is how you can easily mine xmr on a raspberry pi. It should only take a few minutes to complete.

Requirements

You are going to need a library and tools to mine xmr on a raspberry pi. Please note that this is a raspberry pi it will not mine fast at all. You are going to need to have an updated raspberry pi, and the rest will be installed and downloaded in the install/setup process.

Updating

For your raspberry pi to have the latest software in order to mine xmr, you need to update everything through a small command. Run the following command in a terminal:

sudo apt-get update sudo apt-get upgrade sudo apt-get full-upgrade

When finished, make sure that you reboot if you had over 100 updates/upgrades. Once everything is updated and ready to start mining read the following below to install the miner.

Dependencies

To mine xmr on a raspberry pi, you need to have some packages that run with the mining software. They are the most common ones like CMake and git. But we're not going to install them through a normal terminal, we are going to install them from a special 64bit terminal. The following commands below install the 64bit terminal.

sudo apt-get install -y raspbian-nspawn-64

When the 64bit terminal finishes the install, make sure that you run the command below in a normal terminal as it starts up the 64bit terminal and gets it ready for use.

ds64-shell

Once you have the 64bit terminal ready and set up, run the following command to update packages in the 64bit terminal. This command will also install the dependencies for the xmr miner to run.

sudo apt-get update && sudo apt-get upgrade && sudo apt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev

Once your 64bit terminal has finished up, reboot your raspberry pi as it enables all of the new packages on your raspberry pi and then you will be ready to install the miner.

Now Mine XMR On A Raspberry Pi
Monero

You are all set and good to go now to install xmrig and mine xmr on a raspberry pi. This part will take a little bit though as xmrig needs to compile and install itself on your pi. Run the following command:

git clone https://github.com/xmrig/xmrig.git cd xmrig && mkdir build  && cd build && cmake .. && make

That process will take from 16-30 minutes to complete depending on ram size and CPU speed. Once it finishes though, your pi will be able to mine xmr. Run the command below to run the miner. Make sure to set the -u as the username it's currently set to be mine and set the -o field to the xmr pool of your choice.

./xmrig --donate-level 1 -o pool.minexmr.com:4444 -u 47HqXyfRx6HAhazGSaDp5p3VFyNMtDviQCPo1xHn5hVgezGY1eLiNW4bep9wmi2gKrH8BWXeGH9bYPU9NKcbehRqJSdKWLc -p Pi

Have fun when you mine xmr on a raspberry pi. And you can also set this up on several raspberry pi's to increase speed. Please donate as this site is free to use but the hosting is not.

Discussion (0)