How to Set Up an Ethereum Node on Raspberry Pi

Introduction

Running an Ethereum node on a Raspberry Pi is a cost-effective way to participate in blockchain networks without relying on expensive cloud services. The Raspberry Pi 4 Model B, with its low energy consumption and expandable storage via external drives, is ideal for hosting a lightweight Ethereum full node or Ethereum Classic node. This guide covers the setup process using Ubuntu LTS and Core-geth, optimized for efficiency.


What You’ll Learn

  • Set up a Raspberry Pi 4 (4GB RAM) with Ubuntu LTS and Core-geth.

  • Configure Core-geth to sync with ETC, ETH, or test networks.

  • Optimize storage and memory usage for long-term node operation.


Step 1: Hardware and Software Requirements

Hardware:

  • Raspberry Pi 4 Model B (4GB RAM) – Core-geth requires ≥4GB RAM.

  • MicroSD card (≥16GB) – For the OS.

  • External HDD/SSD (optional for mainnet) – Mainnet requires hundreds of GBs; testnets can use a large microSD.

  • USB-C power supply (5.1V/3A) – Stable power is critical.

  • Ethernet cable (recommended) – More reliable than Wi-Fi.

Software:

  • Ubuntu LTS (22.04 or later).

  • Core-geth (built from source).

👉 Explore Raspberry Pi 4 accessories


Step 2: Install Ubuntu on Raspberry Pi

  1. Follow Ubuntu’s official tutorial:

    # Download and flash Ubuntu LTS to the microSD card.  
    
  2. Find the Pi’s IP address using nmap if SSH fails:

    nmap -sn 192.168.1.0/24  
    

Step 3: Initial Server Setup

Update System Packages:

sudo apt-get update && sudo apt-get upgrade -y  

Install Essential Tools:

sudo apt install unzip make htop build-essential  
sudo snap install go --classic  

Assign a Static IP:

Edit /etc/netplan/50-cloud-init.yaml:

network:  
  ethernets:  
    eth0:  
      addresses: [192.168.1.144/24]  
      gateway4: 192.168.1.1  
      nameservers:  
        addresses: [8.8.8.8, 1.1.1.1]  

Apply changes:

sudo netplan apply && sudo reboot  

Step 4: Mount External Storage

  1. Identify the disk (/dev/sda):

    sudo fdisk -l  
    
  2. Format and mount:

    sudo mkfs.ext4 /dev/sda  
    sudo mkdir /mnt/ssd  
    sudo mount /dev/sda /mnt/ssd  
    
  3. Auto-mount on boot via /etc/fstab:

    UUID=b2907e9d-1a37-4f26-8d43-b51ff3e1c66f /mnt/ssd ext4 defaults 0 0  
    

Step 5: Add Swap Space

Prevent out-of-memory errors with a 2GB swap file:

sudo fallocate -l 2G /swapfile  
sudo chmod 600 /swapfile  
sudo mkswap /swapfile  
sudo swapon /swapfile  

Permanently enable it in /etc/fstab:

/swapfile none swap sw 0 0  

Step 6: Install Core-geth

Build from Source:

git clone https://github.com/etclabscore/core-geth.git  
cd core-geth  
make geth  
sudo mv build/bin/geth /bin/  

Verify installation:

geth version  

Step 7: Run Core-geth

Sync Ethereum Classic:

geth --classic --syncmode fast --cache 256 --datadir /mnt/ssd/classic  

For background operation:

nohup geth --classic --syncmode fast --cache 256 --datadir /mnt/ssd/classic &  

Monitor Sync Status:

geth attach ipc:/mnt/ssd/classic/geth.ipc  
> eth.syncing  

👉 Troubleshoot common node issues


FAQs

1. Can I run an Ethereum archival node on Raspberry Pi?

  • Not recommended due to storage constraints (archival nodes require ~4TB+).

2. How long does syncing take?

  • Fast sync: 1–3 days for Ethereum Classic (varies by network load).

3. Why use an external SSD?

  • MicroSD cards wear out faster under constant read/write cycles.

4. How to reduce RAM usage?

  • Lower --cache (e.g., --cache 128) and ensure swap is active.

5. Can I switch networks later?

  • Yes! Use separate --datadir paths (e.g., /mnt/ssd/eth vs. /mnt/ssd/etc).

Final Tips

  • Use htop to monitor CPU/RAM usage.

  • Regularly back up your datadir to avoid re-syncing.

  • Join forums like Ethereum Stack Exchange for community support.

By following this guide, you’ve created a low-cost, energy-efficient Ethereum node—ideal for developers and enthusiasts alike!

Subscribe to okx login
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.