below is a **practical, ready-to-run guide** for *real* crypto mining on a Raspberry Pi (ARM64). I’ll focus on **Monero (XMR)** because it’s one of the few widely-used, CPU-friendly coins (RandomX). **Important**: Raspberry Pi can run a real miner and submit shares to a pool, but its hashpower and profitability are very low compared with desktop/server CPUs. I’ll give compile/run instructions, a sample xmrig config, a systemd service, and operational tips — plus explicit warnings about performance and power costs. Sources for the most important claims are cited as requested. ([wantclue.de][1])
# What we'll do
1. Install Raspberry Pi OS 64-bit and prerequisites.
2. Build XMRig from source (ARM64).
3. Configure XMRig to mine with a pool.
4. Run it as a systemd service.
5. Monitor and optional tuning.
# Requirements (hardware & notes)
* Raspberry Pi 4/5 with **64-bit OS** (Raspberry Pi OS 64-bit or other arm64 distro). Use a Pi 4/5 for best performance. ([wantclue.de][1])
* Good active cooling (heatsink, fan). RandomX uses CPU heavily.
* Reliable internet & power supply.
* Monero wallet address (or pool username/email). Use a proper wallet (GUI or CLI).
* (Optional) Multiple Pi units — mining scales linearly but still tiny.
# 1) Prepare the Pi (64-bit OS + packages)
Flash a **64-bit Raspberry Pi OS** image (Raspberry Pi Imager → Raspberry Pi OS (Other) → 64-bit). Then SSH or open terminal and run:
bash
# update
sudo apt update && sudo apt upgrade -y
# install build deps
sudo apt install -y git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
# libhwloc-dev helps XMRig schedule threads for CPU topology
(If you prefer prebuilt containers, there are Docker images for ARM64 too — but building from source gives compatibility.) ([wantclue.de][1])
# 2) Build XMRig from source (ARM64)
bash
# clone
git clone https://github.com/xmrig/xmrig.git
cd xmrig
# create build dir and cmake
mkdir build && cd build
cmake .. -DXMRIG_DEPS=ON
# build (use all CPU cores)
make -j$(nproc)
Notes:
* Some users reported needing minor tweaks or additional libs on ARM; if cmake fails, inspect error messages and install missing -dev packages. There are community threads describing fixes for Pi/ARM. ([GitHub][3])
If compilation succeeds you’ll have
xmrig
binary in
build/
.
# 3) Get a Monero wallet & choose a pool
* Create a Monero wallet (official GUI or CLI) and get your **wallet address**.
* Choose a mining pool (e.g.,
pool.minexmr.com
,
supportxmr.com
,
mineXMR
) — each has a host:port and sometimes stratum options. Pools update over time; check the pool docs for the correct port and settings. ([exolix.com][4])
# 4) Sample xmrig config (quick start)
XMRig accepts CLI flags or a JSON config. Create
config.json
in the
build
folder (or use the
--url --user
flags). Example minimal config:
json
{
"autosave": true,
"cpu": {
"enabled": true,
"huge-pages": true,
"hw-aes": false,
"priority": null,
"memory-pool": false,
"max-threads-hint": 100
},
"pools": [
{
"url": "pool.minexmr.com:4444",
"user": "YOUR_MONERO_WALLET_ADDRESS",
"pass": "raspberrypi",
"keepalive": true,
"algo": null,
"coin": null
}
]
}
Replace
YOUR_MONERO_WALLET_ADDRESS
with your actual address. You can also add
rig-id
or worker name in
pass
or
user
depending on pool. Use pool docs to find recommended ports (TLS, non-TLS) and URLs. ([exolix.com][4])
Alternatively run directly:
bash
./xmrig -o pool.minexmr.com:4444 -u YOUR_ADDRESS -p pi-worker
# 5) Run and test
From
build/
:
bash
./xmrig
You’ll see console output: accepted shares, hash rate, threads used. Monitor CPU load with
htop
.
# 6) Create a systemd service (auto-start)
Create
/etc/systemd/system/xmrig.service
:
ini
[Unit]
Description=XMRig Monero miner
After=network.target
[Service]
ExecStart=/home/pi/xmrig/build/xmrig --config=/home/pi/xmrig/build/config.json
Nice=0
User=pi
Restart=on-failure
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
Enable + start:
bash
sudo systemctl daemon-reload
sudo systemctl enable xmrig
sudo systemctl start xmrig
sudo journalctl -u xmrig -f
# 7) Tuning & tips
* **Threads**: RandomX efficiency depends on cache per thread (L1/L2/L3). Raspberry Pi has small caches; using too many threads lowers per-thread efficiency. Start with 1–2 threads and measure. ([Monero Stack Exchange][2])
* **Huge pages**: XMRig uses huge pages for RandomX; ensure
vm.nr_hugepages
is set and hugepages available. If permission errors, run as root or enable hugepages.
* **Thermals**: Monitor temps (
vcgencmd measure_temp
); throttle will reduce hash. Use active cooling.
* **Power vs reward**: On a Pi, electricity cost may exceed any mined value. Monitor energy draw (USB power meter) and estimate ROI.
* **ARM optimizations**: Some ARM CPUs and OS kernels provide better performance; community builds or patches may improve performance (see threads). ([GitHub][3])