Is it possible to run an Ethereum 2.0 validator on a Raspberry Pi?
By: Brian Fitzgerald
Tags: Raspberry Pi, Ubuntu, Lighthouse, Ethereum

I’ve been a Raspberry Pi hobbyist for years. I also invested early in Ethereum and had racked up enough, just, to put 32 Eth down as a two year commitment to staking Ethereum 2.0. So my natural inclination was to build my validator on the platform I knew best. There were a couple pre-built images for Pi that included validator software, but was I going to risk not knowing what was under the hood with a 15K USD investment at stake? I really wanted to build from scratch.

Again and again I heard dire warnings. “You need a REAL computer.” “The Pi is too underpowered to keep up when the network gets busy.” And when I successfully ran on the testnets, I’d get “Testnet is one thing, but it’ll never keep up on the mainnet.” Despite the obvious question of what good is a testnet if it doesn’t replicate conditions on the mainnet, I had deep, deep misgivings. About 32 Eth worth of misgivings. As Genesis approached I had an order for a NUC queued up and ready to go for that-day delivery and was asking panicked questions about whether I could just swap my SSD to the new machine and boot. I had nightmares of seeing red attestation blocks and watching as my local geth block number slid ever farther from the blockchain head as I waited for equipment delivery and struggled to configure a new rig while the penalties on my validators for being offline mounted.

Instead, one week after Genesis, this is what I’m calmly seeing on beaconcha.in:

100% Attestation Effectiveness. Flawless performance. Running a local version of Geth as well as a Lighthouse validator. (UPDATE 8 January: One month on, same performance: 100% Attestation Effectiveness, 13% APR projected, 11 blocks proposed, and my rig ranks in the top 5.89% of validators).

So the answer is yes, you CAN run an Ethereum validator on a $75 Pi instead of a much more expensive rig. (On paper, between earned ETH and price increases, I made back the costs of the Pi, the SSD, and my Uninterruptible Power Supply within the first couple weeks of staking).

UPDATE, 19 March 2021: Geth’s new Snapshot feature caused an Out Of Memory issue for me last weekend. While Systemd gracefully shut down the Lighthouse Beacon and Validator, it failed to restart the validator, and as a result I stopped attesting. A simple reboot and I was back in business, but on advice of the devs I’m moving geth onto a another machine (another Pi of course!). I’ll write up the process in another blog. But the long and short of it is my recommendation now would be to split Somer Esat’s setup across two machines, one for Geth, the other for Lighthouse. On the machine running geth, you’ll need to put these flags into the ExecStart=geth line: — rpc — rpcaddr 0.0.0.0 — rpcport 8545 And change the Endpoint in your Lighthouse machine to the network address of the geth machine and port 8545, e.g. http://192.168.178.66:8545

Here’s my setup:

Raspberry Pi 4 with 8GB memory(I tried with a 4GB on the Medalla test net, it slowed to molasses when using swap memory and dropped too many blocks to keep up. You really need an 8GB box). (Shameless plug: Buy it from the good folks at AdaFruit.com and support their awesome Women and Minority owned efforts to teach code to all.)

Ubuntu 20.04 LTS. At the time I built, you needed to run Ubuntu to take advantage of the Pi 4’s 64Bit architecture. Even with the availability of 64Bit Debian builds for the Pi, running Ubuntu has the advantage of letting you use the excellent Ubuntu guides that are out there for tasks like SSD preparation and validator setup — it’s a more robust choice unless you’re seriously comfortable in unexplored territory.

EnerGenie UPS: I plug both my Pi and internet router into this 650VA — 390W unit, which will give me some battery life protection against power outages.

Samsung T5 500GB SSD (you may want to bump this up to 1 TB. The Geth database is currently occupying some 375 GB of space, and while it will be a while before I run out of disc space, this is a two-year marathon, and I definitely wish I’d gone for the Terabyte version to save aggro down the road. (UPDATE: Make that 2TB. I ran through that 500GB in the first month. Thanks to Lighthouse’s Fallback Eth1 endpoints I was able to shut down, duplicate the SSD with dd to a 2TB version and get back on line in the space of an hour. Total penalty: .00004 Eth or USD 0.48 at the day’s rate.)

1. Format the Samsung as a boot drive using this excellent guide from Zakaria Smahi.

2. Install glances to monitor the Pi’s disk usage, temperature, and CPU usage.

sudo apt-get install glances

Most stakers seem to be running Grafana, Prometheus, node_exporter, and Telegraf to monitor validator performance and their rigs. But I wanted to reduce the non-validator processes to an absolute minimum. Glances does a great job of monitoring the hardware performance and Beaconcha.in tells me everything I need to know about my validator’s performance without any memory or cpu overhead from my Pi.

3. Install your client and fund your validator keys

Once you’ve got your Pi booting from the SSD, it’s time to install your validator. I went with Lighthouse and can totally recommend it: the ability to configure with a fallback ETH1 endpoint means even if my local geth endpoint fails or has to resync I can seamlessly switch over to my Infura endpoint. But you may want to go with Teku or Nimbus to ensure network diversity. Either way, the only guide you’ll need is the appropriate step by step guide from the superhumanly gifted Somer Esat here on Medium. In my case, I used his Guide to Staking with Lightning on Ubuntu. I followed it to the letter, with two exceptions:

You can download the precompiled ARM64 version of the latest Lighthouse release without cloning the git and making the file — again, minimizing processor load.

Copy the url of the binary, then paste it into the curl -LO statement below:



$ cd ~

$ curl -LO $ cd ~$ curl -LO https://github.com/sigp/lighthouse/releases/download/vX.x.x/lighthouse-vX.x.x-aarch64-unknown-linux-gnu.tar.gz

$ mv lighthouse /usr/local/bin $ tar -xvf lighthouse- vX.x.x-aarch64-unknown-linux-gnu.tar.gz $ mv lighthouse /usr/local/bin

Don’t install prometheus, grafana, node_exporter, and telegraf. They’re very pretty, but they come at a memory and cpu cost. And in my view, the less you follow the crowd on third party installations and open ports the more secure you’re going to be. And I should probably note I run headless, and removed all the graphic interface overhead as well:

sudo apt-get remove --auto-remove --purge 'libx11-.*'

sudo apt-get autoremove --purge (repeat this line until no results)

And that’s it. All in all, about a Saturday’s afternoon of work if all goes smoothly, and you’re accelerating the historic launch of Ethereum 2.0, helping create a world with more democratized authority and less carbon emissions, while earning ETH that’s going to continue increasing in value. Win-Win-Win!

UPDATE: Just donated to team Lighthouse on Gitcoins. Support these awesome people!