How to Set Up an Ethereum Node on Ubuntu

·

Running your own Ethereum node gives you direct access to the blockchain, enabling greater privacy, security, and participation in network validation. This guide walks you through setting up a full Ethereum node using Geth (Go Ethereum) on an Ubuntu system. Whether you're a developer, blockchain enthusiast, or preparing for decentralized application (dApp) deployment, this step-by-step tutorial ensures a smooth and reliable node setup.


Install Geth on Ubuntu

The first step is installing Geth, the official Go implementation of the Ethereum protocol. It allows your machine to interact with the Ethereum network as a full or light node.

Start by updating your package list and adding the official Ethereum repository:

sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum

👉 Learn how blockchain nodes power decentralized networks and why running one matters.

Once installed, verify the installation by checking the version:

geth version

You should see output similar to:

Geth Version: 1.13.0-stable
Git Commit: ...
Architecture: amd64
Operating System: linux

A successful version display confirms that Geth is correctly installed and ready for configuration.


Configure Network and Script Management

Before launching your node, identify your server's internal IP address—this is crucial for configuring remote procedure call (RPC) access.

Use the following command to find your IP:

ifconfig -a

Look for the inet addr under your active network interface (e.g., eno1 or eth0). In this example, the internal IP is 173.209.49.10.

Create a Geth Startup Script

To simplify node management, create a startup script named starteth.sh:

#!/bin/bash
nohup geth \
  --rpc \
  --rpcaddr "173.209.49.10" \
  --rpccorsdomain "*" \
  --datadir "/data/ethereum" \
  >> geth.log 2>&1 &

This command:

💡 Best Practice: Store blockchain data on a high-capacity drive, as the Ethereum mainnet exceeds 1TB in size when using snapshot sync.

Save the script and make it executable:

chmod u+x starteth.sh

Create a Stop Script

For clean shutdowns, create stopeth.sh:

#!/bin/bash
PIDS=$(ps -ef | grep geth | grep -v grep | awk '{print $2}')
if [ -n "$PIDS" ]; then
    kill -9 $PIDS
    echo "$(date '+%F %H:%M:%S') Geth process stopped."
else
    echo "$(date '+%F %H:%M:%S') Geth is NOT running!"
fi

Make it executable:

chmod u+x stopeth.sh

Now you can start and stop your node easily:

./starteth.sh   # Start the node
./stopeth.sh    # Stop the node gracefully

Start Syncing the Ethereum Blockchain

Run the startup script to begin syncing with the Ethereum network:

./starteth.sh

Monitor progress by tailing the log file:

tail -f geth.log

Sample log output during sync:

INFO [07-11|21:51:06.609] Imported new chain segment blocks=1 txs=55 mgas=7.992 ...
INFO [07-11|21:51:10.051] Imported new chain segment blocks=1 txs=43 mgas=7.987 ...

Each line indicates newly imported blocks. Initially, syncing from genesis can take 2–4 days, depending on:

👉 Discover how real-time blockchain data powers trading decisions on advanced platforms.

For faster synchronization, consider using snap sync or light sync modes (default in newer Geth versions), which download recent state data instead of processing every historical block.


Verify Synchronization Completion

To check if your node has fully synced, open the Geth JavaScript console:

geth attach http://173.209.49.10:8545

Then run:

eth.syncing

If syncing is complete, it returns false. If still syncing, it shows current block and highest block.

Alternatively, check the current block number:

eth.blockNumber

Compare this value with the latest block on Etherscan (do not include external links per instructions). When both numbers match closely, your node is up-to-date.


Frequently Asked Questions (FAQ)

How long does it take to sync an Ethereum node?

Full sync times vary based on hardware and network speed. On average:

What are the minimum system requirements?

Can I run a node on a VPS (Virtual Private Server)?

Yes. Providers like AWS, Google Cloud, or DigitalOcean work well. Choose regions with low latency to major Ethereum peers (e.g., US East, Frankfurt). Avoid shared CPU instances.

Is RPC access safe with --rpccorsdomain "*"?

While convenient for development, allowing all origins poses security risks in production. For public-facing nodes, restrict domains or use reverse proxies with authentication.

Should I expose my node publicly?

Only if necessary (e.g., hosting dApps). Otherwise, keep RPC behind a firewall and use SSH tunneling for local access.

What happens after the node is synced?

Your node becomes fully functional:


Core Keywords for SEO Optimization

This guide integrates the following core keywords naturally for improved search visibility:

These terms align with common search queries from developers and tech users seeking reliable, hands-on guidance.


By following this guide, you’ve successfully deployed a self-managed Ethereum node on Ubuntu—gaining autonomy over your blockchain interactions. Regular maintenance, secure configurations, and staying updated with Geth releases will ensure long-term reliability.

👉 Explore how verified blockchain data enhances accuracy in crypto trading environments.