Prerequisites
Ensure that your system meets the following requirements:
- RAM: At least 16GB
- Storage: At least 2TB
- Internet: A stable and fast connection
All commands in this guide are executed as the root user.
1. Install Geth
Update and Install Dependencies
Run the following commands to update your system and install essential packages:
1 | sudo apt update && sudo apt upgrade -y |
Install Go (Golang)
Geth requires Go, so install it using the commands below:
1 | wget https://go.dev/dl/go1.21.7.linux-amd64.tar.gz |
Configure Environment Variables
Edit your ~/.bashrc
file:
1 | nano ~/.bashrc |
Add the following lines at the end of the file:
1 | export PATH=$PATH:/usr/local/go/bin |
Apply the changes:
1 | source ~/.bashrc |
Download and Build Geth
1 | git clone https://github.com/ethereum/go-ethereum.git |
2. Running Geth
Create a Data Directory and Start Geth
1 | mkdir ~/ethereum |
This will start Geth and expose the JSON-RPC API on port 8080.
(Optional) Disable IPv6
If you experience network issues, disabling IPv6 can help:
1 | sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 |
3. Install and Run Lighthouse (Consensus Layer)
Ethereum transitioned to Proof-of-Stake (PoS) in 2022. This means you need both:
- Execution Layer (EL) → Geth
- Consensus Layer (CL) → Lighthouse (or another beacon client)
Install Rust and Build Lighthouse
1 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
(Troubleshooting) Install Required Dependencies
If you encounter errors while running make
, install clang
and other required dependencies:
1 | sudo apt install -y libc6-dev build-essential clang cmake |
Run Lighthouse
1 | lighthouse beacon_node --network mainnet --datadir ~/beacon --http --http-address 0.0.0.0 --http-port 5052 --execution-endpoint http://127.0.0.1:8551 --execution-jwt ~/ethereum/geth/jwtsecret --checkpoint-sync-url https://mainnet-checkpoint-sync.attestant.io |
You may check more endpoints at: (https://eth-clients.github.io/checkpoint-sync-endpoints/)
⚠️ Make sure Geth is running before starting Lighthouse.
4. Testing Your Ethereum Node
Once both Geth and Lighthouse are running, you can test your node by making an RPC call:
1 | curl -X POST -H "Content-Type: application/json" \ |
If your node is running correctly, it will return something like:
1 | {"jsonrpc":"2.0","id":1,"result":"0x0"} |
(Replace 192.168.1.150
with your actual server IP.)
Final Notes
- This tutorial sets up an Ethereum full node using Geth and Lighthouse.
- Your node will synchronize with the Ethereum network, which can take time.
- Ensure your system meets the hardware requirements to avoid performance issues.
Check status:
Command:
1 | geth attach ~/ethereum/geth.ipc |
In console:
1 | eth.syncing |
Example results:
1 | { |
1 | net.peerCount |