Staking on the Ethereum 2.0 mainnet marks a pivotal shift in the blockchain’s evolution—from proof-of-work to proof-of-stake. This comprehensive guide walks you through setting up a secure and functional staking node using Ubuntu 20.04, Go Ethereum (Geth), and the ConsenSys Teku client. Whether you're a developer, crypto enthusiast, or long-term investor, this tutorial empowers you to become an active validator and earn staking rewards.
⚠️ Important: You’ll need at least 32 ETH and additional gas fees to participate. Never send ETH directly to any address without understanding the process. This guide ensures your funds are safely deposited into the official Ethereum deposit contract.
Why Stake on Ethereum 2.0?
Ethereum’s transition to proof-of-stake has opened the door for users to help secure the network and earn passive income. By running a validator node, you contribute to consensus, transaction validation, and network decentralization—all while earning ETH rewards over time.
This setup uses:
- Ubuntu 20.04 (LTS) x64 server – A stable, secure OS ideal for server environments.
- Go Ethereum (Geth) – The most widely used Ethereum 1.0 client for syncing the execution layer.
- Teku – A production-grade Eth2 client developed by ConsenSys, known for reliability and enterprise use.
- MetaMask – A browser wallet to manage deposits and track validator status.
👉 Start your Ethereum staking journey securely with trusted tools.
Prerequisites
Before diving in, ensure you meet these requirements:
Technical Knowledge
- Basic understanding of Ethereum, staking, Linux command line, and wallet security.
- Familiarity with SSH, systemd services, and firewall configuration.
Hardware Requirements
To run a full node smoothly:
- CPU: Modern multi-core processor (Intel i7 or equivalent)
- RAM: 8 GB minimum (16 GB recommended)
- Storage: 500 GB SSD (1 TB preferred; Geth alone can consume ~400 GB)
- Internet: Stable connection with sufficient bandwidth and no data caps
💡 Tip: Use a local machine instead of cloud hosting when possible. It enhances decentralization and reduces dependency on third-party providers.
Step 1: Generate Staking Keys and Deposit Data
Each validator requires 32 ETH. If you plan to run multiple validators (e.g., 2 = 64 ETH), prepare accordingly.
Download the Deposit CLI Tool
Visit the official repository:
https://github.com/ethereum/eth2.0-deposit-cli/releases
Download the version matching your OS (Windows, Mac, or Linux).
Run the CLI and Generate Keys
Extract the binary and execute it in your terminal:
Linux/Mac:
./deposit new-mnemonic --num_validators 1 --chain mainnetWindows:
deposit.exe new-mnemonic --num_validators 1 --chain mainnetReplace 1 with your desired number of validators.
You’ll be prompted to:
- Set a keystore password – Save this securely; it’s required to import keys into Teku.
- Back up your mnemonic phrase – This is critical for withdrawals and future key generation.
🔐 Security Note: For maximum safety, run this on an air-gapped computer (disconnected from the internet). Avoid executing it on a device currently online.
After completion, two types of files are generated:
deposit_data-[timestamp].json– Used later for depositing ETH.keystore-m_*.json– Encrypted private keys for each validator.
👉 Learn how to protect your staking keys like a pro.
Step 2: Connect to Your Ubuntu Server
Use SSH to access your server:
ssh username@your_server_ipIf logging in as root, create a dedicated user with sudo privileges:
adduser yourusername
usermod -aG sudo yourusernameOptionally copy SSH keys:
rsync --archive --chown=yourusername:yourusername ~/.ssh /home/yourusernameLog out and log back in with your new user.
Step 3: Update the System
Ensure all packages are up to date:
sudo apt update && sudo apt upgrade -y
sudo apt dist-upgrade -y && sudo apt autoremove -y
sudo rebootStep 4: Secure Your Server
Change SSH Port
Edit the SSH config:
sudo nano /etc/ssh/sshd_configFind #Port 22, uncomment it, and change to a custom port (e.g., 6673). Then restart SSH:
sudo systemctl restart sshReconnect using the new port.
Configure UFW Firewall
Install and configure the firewall:
sudo apt install ufw -y
sudo ufw default deny incoming
sudo ufw default allow outgoingAllow necessary ports:
sudo ufw allow 6673/tcp # Custom SSH port
sudo ufw deny 22/tcp # Block default SSH
sudo ufw allow 30303 # Geth P2P
sudo ufw allow 9000 # Teku P2P
sudo ufw enable
sudo ufw status numberedStep 5: Enable Time Synchronization
Accurate timekeeping is crucial for node operation:
timedatectl
sudo timedatectl set-ntp onRemove outdated NTP daemons if present:
sudo apt-get remove ntp -yStep 6: Set Up Go Ethereum (Geth) Node
Install Geth
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt update
sudo apt install geth -yCreate Service User and Directory
sudo useradd --no-create-home --shell /bin/false goeth
sudo mkdir -p /var/lib/goethereum
sudo chown -R goeth:goeth /var/lib/goethereumConfigure Systemd Service
Create the service file:
sudo nano /etc/systemd/system/geth.servicePaste the following:
[Unit]
Description=Go Ethereum Client
After=network.target
[Service]
User=goeth
Group=goeth
Type=simple
Restart=always
RestartSec=5
ExecStart=geth --http --datadir /var/lib/goethereum --cache 2048 --maxpeers 30
[Install]
WantedBy=default.targetReload and start:
sudo systemctl daemon-reload
sudo systemctl start geth
sudo systemctl enable gethMonitor sync progress:
sudo journalctl -fu geth.serviceCheck sync status:
geth attach http://127.0.0.1:8545
> eth.syncingReturn false means fully synced.
Step 7: Install Teku Client
Download the latest binary from Teku Releases:
cd ~
curl -Lo teku.tar.gz https://dl.bintray.com/consensys/pegasys-repo/teku-latest.tar.gz
tar xvf teku.tar.gz
sudo cp -a teku-* /usr/local/bin/teku
sudo apt install default-jre -y
rm -r teku* && cd ~Step 8: Import Validator Keys
Transfer your keystore-m_*.json files to:
~/eth2deposit-cli/validator_keys/Then move them securely:
sudo mkdir -p /var/lib/teku
sudo cp -a ~/eth2deposit-cli/validator_keys /var/lib/teku/Delete any deposit_data*.json files in that folder.
Create password files for each keystore:
sudo nano /var/lib/teku/validator_keys/keystore-m_*.json.txtEnter the keystore password inside.
Set strict permissions:
sudo chown -R teku:teku /var/lib/teku
sudo chmod -R 700 /var/lib/teku/validator_keysStep 9: Configure Teku as a Service
Create the service:
sudo nano /etc/systemd/system/teku.serviceAdd this configuration:
[Unit]
Description=Teku Eth2 Client
Wants=network-online.target
After=network-online.target
[Service]
User=teku
Group=teku
Type=simple
Restart=always
RestartSec=5
Environment="JAVA_OPTS=-Xmx2g"
ExecStart=/usr/local/bin/teku/bin/teku --data-base-path=/var/lib/teku --eth1-endpoint=http://localhost:8545 --validator-keys=/var/lib/teku/validator_keys:/var/lib/teku/validator_keys --rest-api-enabled=true --rest-api-docs-enabled=true --metrics-enabled --validators-graffiti="YourNodeName"
[Install]
WantedBy=multi-user.targetReload and start:
sudo systemctl daemon-reload
sudo systemctl start teku
sudo systemctl enable tekuMonitor logs:
sudo journalctl -fu teku.serviceWait for full sync before depositing.
Step 10: Make Your Deposit
Go to the official launchpad:
https://launchpad.ethereum.org
- Select number of validators.
- Upload
deposit_data-[timestamp].json. - Connect MetaMask.
- Confirm transactions.
All deposits are irreversible—double-check everything.
Step 11: Monitor Your Validator
Track status at beaconcha.in using your wallet or public key. Activation may take hours to days depending on queue length.
Use tools like htop to monitor system resources.
Frequently Asked Questions (FAQ)
Q: How much ETH do I need to stake?
You need exactly 32 ETH per validator. You can run multiple validators, but each requires a separate 32 ETH deposit.
Q: Can I withdraw staked ETH?
Yes, but only after enabling withdrawals in post-Merge upgrades. Full withdrawal functionality requires both withdrawal credentials and proper key management.
Q: What happens if my node goes offline?
You’ll incur minor penalties during downtime. Frequent or prolonged outages reduce rewards and may lead to slashing in extreme cases.
Q: Is cloud hosting safe for staking?
Cloud servers work but increase centralization risk. If your provider fails, so does your node. Local hardware offers better resilience.
Q: How do I update Geth or Teku?
Regular updates are essential. Stop services, download new binaries, replace old ones, then restart. Always check logs post-update.
Q: Can I use a different client than Teku?
Yes—clients like Lighthouse, Prysm, and Nimbus are also compatible. This guide focuses on Teku for its enterprise-grade stability.
Final Notes
Congratulations—you’ve successfully set up an Ethereum 2.0 staking node! You’re now part of a decentralized network securing one of the world’s most important blockchains.
👉 Explore more ways to grow your crypto portfolio safely.
Stay engaged:
- Join EthStaker Discord for community support.
- Follow official client documentation.
- Regularly back up keys and passwords.
- Monitor node health via beacon chain explorers.
By contributing your node, you’re not just earning rewards—you’re helping shape the future of Web3.
This guide is for educational purposes only and does not constitute financial or legal advice.