Securing Ubuntu OS for Ethereum staking
In the matter of security, you must think about the way you are going to connect to / access your node - see the guide below.
Upgrade & update on the latest software and security updates.
sudo apt update && sudo apt -y upgrade
sudo apt dist-upgrade && sudo apt autoremove
sudo reboot
You can also create a shell script that will do this either on manual request or a schedule, see Update and Restart Ubuntu server Utility.
Install UFW, configurate deny state for incoming and allow state for outgoing traffic
- Install UFW (if not installed yet)
sudo apt install ufw - Set default Fireall configuration:
sudo ufw default deny incomingsudo ufw default allow outgoing
NOTE: Installed firewall is required for enabling custom SSH port for remote connection. Firewall activation itself will be processed later, after additional configuration made in next steps.
Managing the SSH access
- SSH allows to connect to the server remotely either from the local or remote network.
- If you are going to connect your node locally only (= with monitor and keyboard connected right in the node), you do not need to install SSH or you can simply disable it, if is already installed.
Check, whether SSH is installed on the server
which sshd
This command should print directory of the SSH service. If it prints an empty response, SSH is not installed on the server and thus connecting to server over SSH is not possible.
With allowed SSH access, you must protect SSH access to your server from attackers. Based on your network confifuration, access may be possible from:
- From any network (Your server has public IP)
- From a local network only (Your server is behind nat)
- From a VPN network the node is assigned to
Even if you have enabled access from a local netowk only (your node is behind NAT), you should still protect your SSH access as a potential attacker may use a compromised device in your local network to access your node. The defense consists in increasing the number of obstacles that must be overcome to access your node.
- Configure SSH keys and harden the SSH server (incl. optional port change)
- Configurate 2FA authentization
- Configurate Brute-force & DDoS protection
- Additional tips
SSH is not installed yet (which sshd returns an empty response), SSH server can be installed with following command:
sudo apt install openssh-server
After the installation, you can use command poweroff to shut down the server and unstick monitor and keyboard. Next connections can be remote over SSH since now. As there is no SSH key used right now, a remote connection can be made with following command (Linux, Mac and Windows 10/11 PowerShell, which has a built-in SSH client):
ssh -o IdentitiesOnly=yes -o PreferredAuthentications=password username@server_ip -p 22
Before configuring security matters and connecting to your node, take note the basic rule to maintain also the security of the computer(s) you are going to use for connecting to your node (stealing the SSH keys) as well as other devices required for connection (stealing 2FA codes) etc.
Configuring SSH keys and hardening the SSH server
By default, SSH connections can be made using a combo of username and password, which is susceptible to brute-force and key logger attacks. The guide walks you through generating an ed25519 key, uploading it to the node and a ~/.ssh/config shortcut. Then it hardens the SSH server in a separate file /etc/ssh/sshd_config.d/00-hardening.conf: key-only login, no root login and an optional custom SSH port (incl. the firewall order and the ssh.socket specifics of Ubuntu 24.04), followed by verification. Commands are filled in from your details (user, address, port).
Configuring 2FA authentization
2FA (2 Factor authentization) comes with additional code you must provide to access your node. You may know 2FA from crypto exchanges. In the same way you can protect loging to your node.
2FA Google Authentication activation guideConfiguring Brute-force & DDoS protection
To defend against Brute Force and DDoS attacks, one can monitor incoming connections and block IP addresses that repeatedly attempt to log in with incorrect credentials. Installing the Fail2Ban package can assist with this.
Guide to activate Fail2Ban.Securying remote access tips
- Staking node is accessible from public IP:
- If you do not need o connect to your node from remote networks, move your node behind the router that prevents accessing the node.
- If you want to keep this feature, you should still consider move the node behind the router, set VPN on the router, and when connecting to the node, firstly connect to the router VPN and then connect the node from "local" network through its local IP.
- Staking node is not accessible from public IP:
- If you need connecting your node from remote networks, you must either set a VPN, such as Tailscale (either on the server itself or any other device in your local network), or buy public IP from your ISP and follow the points for server accessible from the public IP.
If you have SSH installed and running on your server, you must either disable ports for SSH traffic, disable SSH or remove it. If SSH is not installed on your machine, you can skip this step - ssh access is not possible already.
Option 1: Stop and disable the ssh service
sudo systemctl stop ssh sudo systemctl disable sshIf preferred, you can remove the SSH server client from the machine
sudo apt remove openssh-serverOption 2: Disable traffic on SSH port
Check
22/tcpport for enabled traffic with commandsudo ufw status numberedNote: default
22port could be changed, as well as could not be enabled. If there's anytcptraffic enabled, disable it. Code below is for default SSH port22.sudo ufw deny 22/tcp
Configure the Firewall
- Enable Firewall
sudo ufw enable - Check Firewall Ports
sudo ufw numbered
Generate Client Authentication Secret for ethereum
- Create a new directory for
jwtsecretfilessudo mkdir -p /var/lib/jwtsecret - Generate the JWT file using the openssl cryptography software library.
openssl rand -hex 32 | sudo tee /var/lib/jwtsecret/ethereum.hex > /dev/null - Check the generated authentication secret
Pressnano /var/lib/jwtsecret/ethereum.hexCTRL+Xto exit the config file.
Consider installing and setting VPN to hide your public IP
VPN allows the server to access the internet through an intermediary in a form of a VPN server. In such case, your server's IP address (and location) is hidden behind the VPN server IP address. The disadvantage is the potential instability of the VPN server, in terms of connection speed and possible crashes into offline state.
Install, configurate and activate VPN service on Ubuntu server.Note: If you need to have active Mullvad and Tailscale VPNs simultaneously, follow a guide for setting rules for netfilter.
Check / set basic config for your staking node
- Check, you are not logged in as
root. If so, create a new user withsudo, see section Staking on rented hardware - Check a
swapspacefree -hIf there's no
swapspace created on your node, configurate a swap space. - Verify system time synchronization using
timedatectlA validator needs accurate system time to operate correctly. Check the current synchronization state:
timedatectl statusNTP servicemust be showactive.System clock synchronizedmust showyes.
If the system time is not being updated — either right after startup or during operation — your network or VPN may be blocking standard NTP traffic (UDP/123), or the default
systemd-timesyncdservice may not be running reliably.For detailed troubleshooting steps for
Troubleshooting Time Synchronizationsystemd-timesyncdas well as switching at alternative synchronization util Chrony, see the guide below. - Create
downloadsdirectory in your machinemkdir ~/downloadsThis folder will be used for downloading clients
Check / set basic config for your staking node
Perfect, now we can move on configuring individual clients
Default vs custom settings for staking clients
Default settings is great. It's absolutely preferred to start with first clients running in the default settings. Sometimes later, when you want e.g. switch at other client, you can use a custom settings for this new client only. This applies also for settings clients on another chain. The custom options below allow all this. Anyway, if you are a beginner, just ignore the ports settings and so on and use the default options everywhere.
Install and configurate preferred execution client
Install Nethermind client
Nethermind documentation: https://docs.nethermind.io/
-
Find the latest stable version of Nethermind on Github
- Find latest Nethermind version at https://github.com/NethermindEth/nethermind/releases
-
Write latest stable Nethermind version in format such as
2.2.2-be201120:
-
Download Nethermind version
2.2.2-be201120to your nodecd ~/downloads && curl -LO https://github.com/NethermindEth/nethermind/releases/download/2.2.2/nethermind-2.2.2-be201120-linux-x64.zip -
Install package for unzipping
sudo apt-get install -y unzip -
Unzip the downloaded file
unzip nethermind-2.2.2-be201120-linux-x64 -d nethermind -
Copy the client to
/usr/local/bin/sudo cp -a nethermind /usr/local/bin/nethermind -
Remove downloaded files
cd ~/downloads && rm nethermind-2.2.2-be201120-linux-x64.zip && rm -r nethermind
Create a system user and data directory for Nethermind service
-
Create a user
:sudo useradd --system --no-create-home --shell /bin/false eth-nethermind -
Create a folder for Nethermind data on Ethereum chain
:sudo mkdir -p /var/lib/ethereum/nethermind -
Set access permission and ownership for the Nethermind data folder
sudo chown -R eth-nethermind:eth-nethermind /var/lib/ethereum/nethermind
Configurate & Run Nethermind service
-
Choose ports for communication
Change the default ports below if you are going to stake on more chains simultaneously (e.g. Ethereum and Gnosis at once) on the same machine. If you are going to stake ethereum only, you can keep the default ports. If you are changing the default ports, be sure that the newly selected port is not already in used. A port in used may be checked with following code:
ss -tuln | grep ':PORT'- If it returns empty response, the port is free and can be used.
Ports selection
-
(Default port:30303) -
(Default port:8545) -
(Default port:8551)
If needed, check JSON RPC server and fundamentals in Nethermind documentation.
-
Enable ports communication
To allow execution client synchronization, there's need to enable port
30303reserved for P2P traffic to TCP (allows the node to connect to peers) and UDP (allows node discovery). It may be done with following UFW setup:sudo ufw allow 30303Use this option only if you need operate execution client and beacon client on different machines.
-
Enable port
30303for P2P trafficTo allow execution client synchronization, there's need to enable port
30303reserved for P2P traffic to TCP (allows the node to connect to peers) and UDP (allows node discovery). It may be done with following UFW setup:sudo ufw allow 30303 -
Enable port
8551for IP of your second machinesudo ufw allow from 192.168.88.0/27 to any port 8551Note: Be sure you use proper IP of your second machine / proper local network configuration.
-
-
Create configuration file for Nethermind service
-
Open Nethermind configuration file
sudo nano /etc/systemd/system/eth-nethermind.service -
Copy the configuration below into the file.
If needed, check flags documentation.
[Unit] Description=Nethermind Execution Client (Ethereum Mainnet) After=network.target Wants=network.target [Service] User=eth-nethermind Group=eth-nethermind Type=simple Restart=always RestartSec=5 WorkingDirectory=/var/lib/ethereum/nethermind Environment="DOTNET_BUNDLE_EXTRACT_BASE_DIR=/var/lib/ethereum/nethermind" ExecStart=/usr/local/bin/nethermind/nethermind \ --config mainnet \ --datadir /var/lib/ethereum/nethermind \ --Sync.SnapSync true \ --Sync.AncientBodiesBarrier 11052984 \ --Sync.AncientReceiptsBarrier 11052984 \ --JsonRpc.JwtSecretFile /var/lib/jwtsecret/ethereum.hex \ --Network.P2PPort 30303 \ --Network.DiscoveryPort 30303 \ --JsonRpc.EnginePort 8551 \ --JsonRpc.Port 8545 \ --Pruning.Mode Hybrid \ --Pruning.FullPruningTrigger VolumeFreeSpace \ --Pruning.FullPruningThresholdMb 512000 [Install] WantedBy=default.target -
Press
CTRL+XthenYthenENTERto save and exit the config file.
-
-
Start the Nethermind service
sudo systemctl daemon-reload sudo systemctl start eth-nethermind -
Check the service
systemctl status eth-nethermindjournalctl -fu eth-nethermindIf you see message "Waiting for Forkchoice message from Consensus Layer to set fresh pivot block", you can move on a Consensis Client setup.
-
Start the service automatically on system startup
sudo systemctl enable eth-nethermindNote
This option requires the following installed utils:
A guide to install the util is attached on the Github.
- Open Delayed Start shell
sudo nano /usr/local/bin/delayed-start.shConfigurate service start inside it
systemctl start eth-nethermind.service - Be sure,
delayed-start.serviceservice controllingdelayed-start.shis enabled for auto start with system startupsudo systemctl enable delayed-start.service
Note
This option requires the following installed utils:
A guide to install each util is attached on the Github.
Configurate Staking Manager util
- Open the configuration file
sudo nano /usr/local/etc/staking/config/clients.confIf the file is empty, generate it with command
sudo /usr/local/bin/staking.sh init - Set link to proper service. It should be as follow:
executionServices="eth-nethermind"If you place more services to the category, separate them with a space, see
executionServices="service1 service2 service3 ..."
- Open the configuration file
-
Activate service to start automatically on OS startup
- Open Start with delay util
sudo nano /usr/local/bin/delayed-start.sh - Place or uncomment a command to start the execution client(s)
/usr/local/bin/staking.sh start execution - Verify, that a service `
delayed-start.service` exists and is automatically launched on system start.sudo systemctl enable delayed-start.service
- Open Start with delay util
- Open Delayed Start shell
Install Erigon client
Erigon documentation: https://erigon.gitbook.io/erigon
Find the latest stable version of Erigon on Github
- Find latest Erigon version at https://github.com/ledgerwatch/erigon/releases. AMD64 v1/v2 links at Microarchitecture levels.
- Write latest stable Erigon version:
-
Download Erigon version
3.8.1cd ~/downloads && curl -LO https://github.com/erigontech/erigon/releases/download/v3.8.1/erigon_v3.8.1_linux_amd64v2.tar.gz Verify hash of donwnloaded file
Get hash of downloaded file and compare it with official hashes
And check it compare to the provided hash for the file from https://github.com/erigontech/erigon/releases/download/v3.8.1/erigon_v3.8.1_checksums.txt (Note: The link links at 3.8.1 version )sha256sum erigon_v3.8.1_linux_amd64v2.tar.gz-
Extract the downloaded package
tar xvf erigon_v3.8.1_linux_amd64v2.tar.gz -
Copy extracted Erigon library
sudo cp -a erigon_v3.8.1_linux_amd64v2 /usr/local/bin/erigonlib -
Remove downloaded files
cd ~/downloads && rm -r erigon_v3.8.1_linux_amd64v2.tar.gz && rm -r erigon_v3.8.1_linux_amd64v2
Create a system user and data directory for Erigon service
Create a user
:sudo useradd --system --no-create-home --shell /bin/false eth-erigonCreate a folder for Erigon data on ethereum network
:sudo mkdir -p /var/lib/ethereum/erigon-
Set access permission and ownership for the Erigon data folder
sudo chown -R eth-erigon:eth-erigon /var/lib/ethereum/erigon
Configurate & Run Erigon Service
-
Choose ports for communication
Change the default ports below if you are going to stake on more chains simultaneously (e.g. Ethereum and Gnosis at once) on the same machine. If you are going to stake ethereum only, you can keep the default ports. If you are changing the default ports, be sure that the newly selected port is not already in used. A port in used may be checked with following code:
ss -tuln | grep ':PORT'- If it returns empty response, the port is free and can be used.
Ports selection
-
(Default port:30303) -
(Default port:8545) -
(Default port:8551)
-
Enable ports communication
To allow execution client synchronization, there's need to enable port
30303reserved for P2P traffic to TCP (allows the node to connect to peers) and UDP (allows node discovery). It may be done with following UFW setup:sudo ufw allow 30303Use this option only if you need operate execution client and beacon client on different machines.
-
Enable port
30303for P2P trafficTo allow execution client synchronization, there's need to enable port
30303reserved for P2P traffic to TCP (allows the node to connect to peers) and UDP (allows node discovery). It may be done with following UFW setup:sudo ufw allow 30303 -
Enable port
8551for IP of your second machinesudo ufw allow from 192.168.88.0/27 to any port 8551Note: Be sure you use proper IP of your second machine / proper local network configuration.
-
Create configuration file for Erigon service
- Open configuration file
sudo nano /etc/systemd/system/eth-erigon.service - Copy the configuration below into the file
[Unit] Description=Erigon Execution Client (Ethereum Mainnet) After=network.target Wants=network.target [Service] User=eth-erigon Group=eth-erigon Type=simple Restart=always RestartSec=5 ExecStart=/usr/local/bin/erigonlib/erigon \ --chain=mainnet \ --datadir=/var/lib/ethereum/erigon \ --authrpc.jwtsecret=/var/lib/jwtsecret/ethereum.hex \ --port=30303 \ --http.port=8545 \ # --ws.port=8546 \ --authrpc.port=8551 \ --private.api.addr=127.0.0.1:9090 \ --torrent.port=42069 \ --externalcl # --prune=htcr # --private.api.addr= \ # --prune.r.before=11052984 [Install] WantedBy=default.targetNOTE: If you are going to run StakeWise vault, you should set
--prune=receipts --prune.to=18470089according to StakeWise operator service guide. - Press
CTRL+XthenYthenENTERto save and exit the config file.
- Open configuration file
Reload daemon
sudo systemctl daemon-reloadStart the service
sudo systemctl start eth-erigonCheck the service
systemctl status eth-erigonjournalctl -fu eth-erigonStart the service on system startup
sudo systemctl enable eth-erigonNote
This option requires the following installed utils:
A guide to install the util is attached on the Github.
- Open Delayed Start shell
sudo nano /usr/local/bin/delayed-start.shConfigurate service start inside it
systemctl start eth-erigon.service - Be sure,
delayed-start.serviceservice controllingdelayed-start.shis enabled for auto start with system startupsudo systemctl enable delayed-start.service
Note
This option requires the following installed utils:
A guide to install each util is attached on the Github.
Configurate Staking Manager util
- Open the configuration file
sudo nano /usr/local/etc/staking/config/clients.confIf the file is empty, generate it with command
sudo /usr/local/bin/staking.sh init - Set link to proper service. It should be as follow:
executionServices="eth-erigon"If you place more services to the category, separate them with a space, see
executionServices="service1 service2 service3 ..."
- Open the configuration file
-
Activate service to start automatically on OS startup
- Open Start with delay util
sudo nano /usr/local/bin/delayed-start.sh - Place or uncomment a command to start the execution client(s)
/usr/local/bin/staking.sh start execution - Verify, that a service `
delayed-start.service` exists and is automatically launched on system start.sudo systemctl enable delayed-start.service
- Open Start with delay util
- Open Delayed Start shell
Soon
Soon
Install and configurate preferred Consensus client
Communication ports selection
Each service on the server needs a custom port for communication. Through ports, consensus client communicates with other peers in the network as well as other services running on the server, such as validator clients. There is an IPv4 and IPv6 variant, depending on the ISP support / preference. Each protocol version needs custom port. If you are not sure what to select, continue with default IPv4 port.
-
Configurate public IPv4 port for P2P communication with other peers
- :
- Verify availability of selected port
9000ss -tuln | grep ':9000'If it returns empty response, the port
9000is free and can be used. - Enable traffic on the port through UFW
sudo ufw allow 9000 - Disable IPv6 traffic on the port
- List allowed ports
sudo ufw status numbered - Find order number for V6, see
9000 (V6)and remove it with the following linesudo ufw delete <Number>
- List allowed ports
QUIC IPv4 port
- :
- Verify availability of selected port
9001ss -tuln | grep ':9001'If it returns empty response, the port
9001is free and can be used. -
Beacon API port for internal communication
- :
- Verify availability of selected port
5052ss -tuln | grep ':5052'If it returns empty response, the port
5052is free and can be used.
-
Configurate public IPv6 port for P2P communication with other peers
- :
- Verify availability of selected port
9090ss -tuln | grep ':9090'If it returns empty response, the port
9090is free and can be used. - Enable traffic on the port through UFW
sudo ufw allow 9090 - Disable IPv6 traffic on the port
- List allowed ports
sudo ufw status numbered - Find order number for V6, see
9090and remove it with the following linesudo ufw delete <Number>
- List allowed ports
QUIC IPv6 port
- :
- Verify availability of selected port
9091ss -tuln | grep ':9091'If it returns empty response, the port
9091is free and can be used.
Install preferred Consensus client
Install Lighthouse
-
Find the latest stable version of Lighthouse on Github
- Find latest Lighthouse version at https://github.com/sigp/lighthouse/releases
-
Write latest stable lighthouse version:
This will update the url links in the guide below.
-
Download Lighthouse version
8.3.3to your nodecd ~/downloads && curl -LO https://github.com/sigp/lighthouse/releases/download/v8.3.3/lighthouse-v8.3.3-x86_64-unknown-linux-gnu.tar.gzExtract downloaded file
tar xvf lighthouse-v8.3.3-x86_64-unknown-linux-gnu.tar.gz -
Place / replace Lighthouse client
sudo cp ~/downloads/lighthouse /usr/local/bin -
Remove downloaded files
cd ~/downloads && rm lighthouse-v8.3.3-x86_64-unknown-linux-gnu.tar.gz && rm -r lighthouse
Configurate Lighthouse Beacon service
-
Create a user for lighthouse beacon
:sudo useradd --system --no-create-home --shell /bin/false eth-lighthousebeacon -
Create a directory for data
:sudo mkdir -p /var/lib/ethereum/lighthouse/beacon Set permission for accessing the directory
sudo chown -R eth-lighthousebeacon:eth-lighthousebeacon /var/lib/ethereum/lighthouse/beaconCreate configuration file for Lighthouse Beacon service
Open Lighthouse Beacon configuration file
sudo nano /etc/systemd/system/eth-lighthousebeacon.serviceCopy the configuration below into the file. If needed, check flags documentation.
Notes:[Unit] Description=Lighthouse Consensus Client BN (Ethereum Mainnet) Wants=network-online.target After=network-online.target [Service] User=eth-lighthousebeacon Group=eth-lighthousebeacon Type=simple Restart=always RestartSec=5 ExecStart=/usr/local/bin/lighthouse bn \ --network mainnet \ --datadir /var/lib/ethereum/lighthouse \ --http \ --execution-endpoint http://127.0.0.1:8551 \ --execution-jwt /var/lib/jwtsecret/ethereum.hex \ # --target-peers 80 \ --checkpoint-sync-url https://beaconstate.info \ --port 9000 \ --port6 9090 \ # --discovery-port 9000 \ --quic-port 9001 \ --quic-port6 9091 \ --http-port 5052 [Install] WantedBy=multi-user.target- You can find all available flags at https://lighthouse-book.sigmaprime.io/help_bn.html
- Update
execution-jwt, if you use different - You can uncomment
--target-peersto reduce bandwidth - You can configurate
checkpoint-sync-urlfor a quick synchronization from a selected Checkpoint sync endpoint. After enabling it, verify, that you are on on the expected chain, see https://beaconstate.info/ → Get started → Lighthouse - If you operate more nodes in the local network, you can configurate
--trusted-peersflag. You can get peer_id from BeaconChain API throughPROTOCOL://IP:PORT/eth/v1/node/identity` command.
datadir- due to a bug, it may be rewritten to wrong value. Properly, it should target lighthouse folder.Press
CTRL+XthenYthenENTERto save and exit the config file.Load changes made in config files to the system
sudo systemctl daemon-reload
Launch the service
- Start the service
sudo systemctl start eth-lighthousebeacon - Check the state
systemctl status eth-lighthousebeacon && journalctl -fu eth-lighthousebeacon -
Activate service to start automatically
sudo systemctl enable eth-lighthousebeaconNote
This option requires the following installed utils:
A guide to install the util is attached on the Github.
- Open Delayed Start shell
sudo nano /usr/local/bin/delayed-start.shConfigurate service start inside it
systemctl start eth-lighthousebeacon.service - Be sure,
delayed-start.serviceservice controllingdelayed-start.shis enabled for auto start with system startupsudo systemctl enable delayed-start.service
Note
This option requires the following installed utils:
A guide to install each util is attached on the Github.
Configurate Staking Manager util
- Open the configuration file
sudo nano /usr/local/etc/staking/config/clients.confIf the file is empty, generate it with command
sudo /usr/local/bin/staking.sh init - Set link to proper service. It should be as follow:
beaconServices="eth-lighthousebeacon"If you place more services to the category, separate them with a space, see
beaconServices="service1 service2 service3 ..."
- Open the configuration file
-
Activate service to start automatically on OS startup
- Open Start with delay util
sudo nano /usr/local/bin/delayed-start.sh - Place or uncomment a command to start the beacon client(s)
/usr/local/bin/staking.sh start beacon - Verify, that a service `
delayed-start.service` exists and is automatically launched on system start.sudo systemctl enable delayed-start.service
- Open Start with delay util
- Open Delayed Start shell
Install Lodestar
-
Install NodeJS through the NVM
Node Version Manager (NVM) is a piece of shell code that allows you to easily install and maintain different versions of Node.js and its associated packages.
- Check latest NVM verision on GitHub.
- View code of latest NVM ver (0.40.4 in this guide)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh - Install latest NVM (0.40.4 in this guide)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bashNVM will be installed with permissions of a user that processing that request (you). NVM is installed to user account, specifically to "~/.bashrc" directory.
- source/reload
nvmfor an option to use itsource ~/.bashrc - Check available Node.js versions
Selected version:nvm list-remotev - Install requested Node.js version
nvm install v24.13.1Node.js is installed with permissions of a user that processing that request (you)
- Show active Node.js version in use
node -vIf no version selected, use
nvm use 24.13.1
Get Lodestar Client
-
Install build-essential tools
sudo apt-get install build-essential -y -
Install pnpm
corepack enablecorepack prepare pnpm@latest --activatepnpm --version -
Build Lodestar
- Download latest Lodestar client from GitHub
cd ~/downloads && git clone -b stable https://github.com/chainsafe/lodestar.git -
Install pnpm
cd lodestar && pnpm clean:nm && pnpm install - Build Lodestart client
pnpm build
Note: If Lodestar build fails with error due to old Node.js or missing corepack, apply the Lodestar Installation guide to install latest Node.js, associated Build essential and Corepack. - Download latest Lodestar client from GitHub
-
Find the latest stable version of Lodestar client on Github
- Find latest Lodestar version at https://github.com/ChainSafe/lodestar/releases
- Write latest stable Lodestar version:
This will update the url links in the guide below.
-
Download Lodestar version
1.50.1to your nodemkdir ~/downloads/lodestarclient && cd ~/downloads/lodestarclient && curl -LO https://github.com/ChainSafe/lodestar/releases/download/v1.50.1/lodestar-v1.50.1-linux-amd64.tar.gz - Extract downloaded file
tar xvf lodestar-v1.50.1-linux-amd64.tar.gz - Create lodestar directory and move the client into it
mkdir ~/downloads/lodestar && mv ~/downloads/lodestarclient/lodestar ~/downloads/lodestar/lodestar
-
Install build-essential tools
-
Check version of new Lodestar client
~/downloads/lodestar/lodestar -v Copy new production client to
/usr/local/bindirectorysudo cp -a ~/downloads/lodestar /usr/local/bin
Configurate Lodestar Beacon service
-
Configuring lodestarbeacon service user and data directory
- Create a service user
:
sudo useradd --system --no-create-home --shell /bin/false eth-lodestarbeacon - Enable eth-lodestarbeacon user access NodeJs
:
sudo usermod -aG nodejsusr eth-lodestarbeacon -
Create a directory for Lodestar Beacon data
:
sudo mkdir -p /var/lib/ethereum/lodestar/beacon -
Set directory ownership
sudo chown -R eth-lodestarbeacon:eth-lodestarbeacon /var/lib/ethereum/lodestar/beacon
- Create a service user
:
Create configuration file for the Lodestar beacon service
- Open the configuration file
sudo nano /etc/systemd/system/eth-lodestarbeacon.service - Copy following configuration to the file
:
This can be get with commandnode -v[Unit] Description=Lodestar Consensus Beacon Client (Ethereum mainnet) Wants=network-online.target After=network-online.target [Service] User=eth-lodestarbeacon Group=eth-lodestarbeacon Type=simple Restart=always RestartSec=5 WorkingDirectory=/usr/local/bin/lodestar Environment="PATH=/home/nodejsusr/.nvm/versions/node/v20.11.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ExecStart=/usr/local/bin/lodestar/lodestar beacon \ --network mainnet \ --dataDir /var/lib/ethereum/lodestar/beacon \ --execution.urls http://127.0.0.1:8551 \ --jwt-secret /var/lib/jwtsecret/ethereum.hex \ --checkpointSyncUrl https://beaconstate.info \ --port 9000 \ --discoveryPort 9000 \ --rest.port 9596 #--port6 9090 #--suggestedFeeRecipient 0x......................... [Install] WantedBy=multi-user.target - Press
CTRL+XthenYthenENTERto save and exit the config file.
- Open the configuration file
- Reload daemon
sudo systemctl daemon-reload - Run the service
sudo systemctl start eth-lodestarbeacon -
Monitor the running lodestar Beacon service
systemctl status eth-lodestarbeaconjournalctl -fu eth-lodestarbeacon - Enable auto start on server statup
sudo systemctl enable eth-lodestarbeaconNote
This option requires the following installed utils:
A guide to install the util is attached on the Github.
- Open Delayed Start shell
sudo nano /usr/local/bin/delayed-start.shConfigurate service start inside it
systemctl start eth-lodestarbeacon.service - Be sure,
delayed-start.serviceservice controllingdelayed-start.shis enabled for auto start with system startupsudo systemctl enable delayed-start.service
Note
This option requires the following installed utils:
A guide to install each util is attached on the Github.
Configurate Staking Manager util
- Open the configuration file
sudo nano /usr/local/etc/staking/config/clients.confIf the file is empty, generate it with command
sudo /usr/local/bin/staking.sh init - Set link to proper service. It should be as follow:
beaconServices="eth-lodestarbeacon"If you place more services to the category, separate them with a space, see
beaconServices="service1 service2 service3 ..."
- Open the configuration file
-
Activate service to start automatically on OS startup
- Open Start with delay util
sudo nano /usr/local/bin/delayed-start.sh - Place or uncomment a command to start the beacon client(s)
/usr/local/bin/staking.sh start beacon - Verify, that a service `
delayed-start.service` exists and is automatically launched on system start.sudo systemctl enable delayed-start.service
- Open Start with delay util
- Open Delayed Start shell
Install Teku
Install Java
cd ~/downloads && wget https://download.oracle.com/java/25/latest/jdk-25_linux-x64_bin.deb
Get installed Java version:sudo apt install ./jdk-25_linux-x64_bin.debjava --version-
Find the latest stable version of Teku on Github
- Find latest Teku version at Github: https://github.com/Consensys/teku/releases
- Write latest stable Teku version:
This will update the url links in the guide below.
Download the latest Teku version
cd ~/downloads && curl -LO https://artifacts.consensys.net/public/teku/raw/names/teku.tar.gz/versions/26.10.3/teku-26.10.3.tar.gzUnpack the downloaded Teku version
tar xvf teku-26.10.3.tar.gz-
Copy the Teku Library
sudo cp -a ~/downloads/teku-26.10.3 /usr/local/bin/teku Remove downloaded files
cd ~/downloads && rm teku-26.10.3.tar.gz && rm -r teku-26.10.3
Configurate Teku Beacon service
-
Create a user
:sudo useradd --system --no-create-home --shell /bin/false eth-tekubeacon -
Create a folder for Tekubeacon data on Ethereum chain
:sudo mkdir -p /var/lib/ethereum/tekubeacon -
Set access permission and ownership for the Teku data folder
sudo chown -R eth-tekubeacon:eth-tekubeacon /var/lib/ethereum/tekubeacon -
Create configuration file for Tekubeacon service
-
Open Tekubeacon configuration file
sudo nano /etc/systemd/system/eth-tekubeacon.service Copy configuration
[Unit] Description=Teku Consensus Client (Ethereum Mainnet) Wants=network-online.target After=network-online.target [Service] User=eth-tekubeacon Group=eth-tekubeacon Type=simple Restart=always RestartSec=5 Environment="JAVA_OPTS=-Xmx12g" Environment="TEKU_OPTS=-XX:-HeapDumpOnOutOfMemoryError" ExecStart=/usr/local/bin/teku/bin/teku \ --network=mainnet \ --data-path=/var/lib/ethereum/tekubeacon \ --ee-endpoint=http://127.0.0.1:8551 \ --ee-jwt-secret-file=/var/lib/jwtsecret/ethereum.hex \ --validators-proposer-default-fee-recipient=0x... \ --checkpoint-sync-url=https://beaconstate.info \ --p2p-port=9000 \ --rest-api-port=5051 \ --validator-api-port=5052 \ --rest-api-enabled=true [Install] WantedBy=multi-user.targetSee more arguments at https://docs.teku.consensys.io/reference/cli
-
Press
CTRL+XthenYthenENTERto save and exit the config file.
-
-
Load changes
sudo systemctl daemon-reload
Launch Tekubeacon service
-
Start the Beacon chain service
sudo systemctl start eth-tekubeacon -
Check the service
systemctl status eth-tekubeaconjournalctl -fu eth-tekubeacon -
Start the service automatically on system startup
sudo systemctl enable eth-tekubeaconNote
This option requires the following installed utils:
A guide to install the util is attached on the Github.
- Open Delayed Start shell
sudo nano /usr/local/bin/delayed-start.shConfigurate service start inside it
systemctl start eth-tekubeacon.service - Be sure,
delayed-start.serviceservice controllingdelayed-start.shis enabled for auto start with system startupsudo systemctl enable delayed-start.service
Note
This option requires the following installed utils:
A guide to install each util is attached on the Github.
Configurate Staking Manager util
- Open the configuration file
sudo nano /usr/local/etc/staking/config/clients.confIf the file is empty, generate it with command
sudo /usr/local/bin/staking.sh init - Set link to proper service. It should be as follow:
beaconServices="eth-tekubeacon"If you place more services to the category, separate them with a space, see
beaconServices="service1 service2 service3 ..."
- Open the configuration file
-
Activate service to start automatically on OS startup
- Open Start with delay util
sudo nano /usr/local/bin/delayed-start.sh - Place or uncomment a command to start the beacon client(s)
/usr/local/bin/staking.sh start beacon - Verify, that a service `
delayed-start.service` exists and is automatically launched on system start.sudo systemctl enable delayed-start.service
- Open Start with delay util
- Open Delayed Start shell
Install Prysm
-
Find the latest stable version of Prysm on Github
- Find latest Prysm version at https://github.com/prysmaticlabs/prysm/releases
-
Write latest stable Prysm version:
This will update the url links in the guide below.
-
Download Prysm clients to your node
cd ~/downloads && curl -LO https://github.com/prysmaticlabs/prysm/releases/download/v7.3.1/beacon-chain-v7.3.1-modern-linux-amd64cd ~/downloads && curl -LO https://github.com/prysmaticlabs/prysm/releases/download/v7.3.1/validator-v7.3.1-linux-amd64 -
Rename downloaded files
mv beacon-chain-v7.3.1-modern-linux-amd64 beacon-chain && mv validator-v7.3.1-linux-amd64 validator -
Set files permissions
chmod +x beacon-chain && chmod +x validator -
Copy clients to
/usr/local/binsudo cp ~/downloads/beacon-chain /usr/local/binsudo cp ~/downloads/validator /usr/local/bin -
Remove downloaded files
cd ~/downloads && rm beacon-chain && rm validator
Configurate Prysm Beacon service
-
Create a user
:sudo useradd --system --no-create-home --shell /bin/false eth-prysmbeacon -
Create a folder for Prysmbeacon data on Ethereum chain
:sudo mkdir -p /var/lib/ethereum/prysm/beacon -
Set access permission and ownership for the Prysm data folder
sudo chown -R eth-prysmbeacon:eth-prysmbeacon /var/lib/ethereum/prysm/beacon -
Create configuration file for Tekubeacon service
-
Open PrysmBeacon configuration file
sudo nano /etc/systemd/system/eth-prysmbeacon.service Copy configuration
[Unit] Description=Prysm Consensus Client BN (Mainnet) Wants=network-online.target After=network-online.target [Service] User=eth-prysmbeacon Group=eth-prysmbeacon Type=simple Restart=always RestartSec=5 ExecStart=/usr/local/bin/beacon-chain \ --mainnet \ --datadir=/var/lib/ethereum/prysm/beacon \ --execution-endpoint=http://127.0.0.1:8551 \ --jwt-secret=/var/lib/jwtsecret/ethereum.hex \ --suggested-fee-recipient=FeeRecipientAddress \ # For Rocketpool / Lido / Forced MEV-boost #--local-block-value-boost=0 \ --checkpoint-sync-url=CheckpointSyncURL \ --genesis-beacon-api-url=CheckpointSyncURL \ --accept-terms-of-use [Install] WantedBy=multi-user.targetAll Prysm Beacon node flags: https://prysm.offchainlabs.com/docs/configure-prysm/parameters/#beacon-node-flags
NOTE: Be sure to set the
FeeRecipientAddressabove to a valid Ethereum address within your control to receive the validator fees.NOTE: Be sure to set the CheckpointSyncURL above (both occurrences) to a valid checkpoint sync URL.
--checkpoint-sync-urland--genesis-beacon-api-urlEnables the Checkpoint Sync feature to greatly speed up the Beacon Chain Node sync. More information here. Provide a URL to a synced Beacon Chain Node for the sync. You can get one here.-
Press
CTRL+XthenYthenENTERto save and exit the config file.
-
-
Load changes
sudo systemctl daemon-reload
Launch PrysmBeacon service
-
Start the Beacon chain service
sudo systemctl start eth-prysmbeacon -
Check the service
systemctl status eth-prysmbeaconjournalctl -fu eth-prysmbeacon -
Start the service automatically on system startup
sudo systemctl enable eth-prysmbeaconNote
This option requires the following installed utils:
A guide to install the util is attached on the Github.
- Open Delayed Start shell
sudo nano /usr/local/bin/delayed-start.shConfigurate service start inside it
systemctl start eth-prysmbeacon.service - Be sure,
delayed-start.serviceservice controllingdelayed-start.shis enabled for auto start with system startupsudo systemctl enable delayed-start.service
Note
This option requires the following installed utils:
A guide to install each util is attached on the Github.
Configurate Staking Manager util
- Open the configuration file
sudo nano /usr/local/etc/staking/config/clients.confIf the file is empty, generate it with command
sudo /usr/local/bin/staking.sh init - Set link to proper service. It should be as follow:
beaconServices="eth-prysmbeacon"If you place more services to the category, separate them with a space, see
beaconServices="service1 service2 service3 ..."
- Open the configuration file
-
Activate service to start automatically on OS startup
- Open Start with delay util
sudo nano /usr/local/bin/delayed-start.sh - Place or uncomment a command to start the beacon client(s)
/usr/local/bin/staking.sh start beacon - Verify, that a service `
delayed-start.service` exists and is automatically launched on system start.sudo systemctl enable delayed-start.service
- Open Start with delay util
- Open Delayed Start shell
Install Nimbus
-
Find the latest stable version of Nimbus on Github
Find latest Nimbus version at Github: https://github.com/status-im/nimbus-eth2/releases
Write latest stable Nimbus version:
This will update the url links in the guide below.
Download the latest Nimbus client
cd ~/downloads && curl -LO https://github.com/status-im/nimbus-eth2/releases/download/v26.10.2/nimbus-eth2_Linux_amd64_26.10.2_0abc0dd0.tar.gzExtract the downloaded package
tar xvf nimbus-eth2_Linux_amd64_26.10.2_0abc0dd0.tar.gzCopy Nimbus clients to
/usr/local/binsudo cp -a nimbus-eth2_Linux_amd64_26.10.2_0abc0dd0/build /usr/local/bin/nimbusRemove downloaded files
rm nimbus-eth2_Linux_amd64_26.10.2_0abc0dd0.tar.gz && rm -r nimbus-eth2_Linux_amd64_26.10.2_0abc0dd0
Install Nimbus' dependencies
sudo apt-get install build-essential git-lfs cmakeDownload the latest Nimbus client
cd ~/downloads && git clone -b stable https://github.com/status-im/nimbus-eth2.gitMove update
cd nimbus-eth2 && make updateBuild Nimbus
make gnosis-buildmake gnosis-vc-buildCopy Nimbus clients to
/usr/local/binsudo cp -a build /usr/local/bin/nimbus
Configurate Nimbus Beacon service
-
Create a user
:sudo useradd --system --no-create-home --shell /bin/false eth-nimbusbeacon -
Create a folder for Nimbus beacon data on Ethereum chain
:sudo mkdir -p /var/lib/ethereum/nimbus/beacon -
Set access permission and ownership for the Nimbus Beacon data folder
sudo chown -R eth-nimbusbeacon:eth-nimbusbeacon /var/lib/ethereum/nimbus/beacon
Configurate & Run Nimbus Beacon service
-
Creating a checkpoint
sudo /usr/local/bin/nimbus/nimbus_beacon_node trustedNodeSync \ --network:mainnet \ --data-dir=/var/lib/ethereum/nimbus/beacon \ --trusted-node-url=https://beaconstate.info -
Create configuration file for Tekubeacon service
-
Open Nimbus Beacon configuration file
sudo nano /etc/systemd/system/eth-nimbusbeacon.service Copy configuration
[Unit] Description=Nimbus Beacon Consensus Client (Mainnet) Wants=network-online.target After=network-online.target [Service] User=eth-nimbusbeacon Group=eth-nimbusbeacon Type=simple Restart=always RestartSec=5 ExecStart=/usr/local/bin/nimbus/nimbus_beacon_node \ --network=mainnet \ --data-dir=/var/lib/ethereum/nimbus/beacon \ --web3-url=http://127.0.0.1:8551 \ --rest \ --rest-port=5052 \ --tcp-port=9000 \ --udp-port=9000 \ #--trusted-node-url=https://beaconstate.info \ --jwt-secret=/var/lib/jwtsecret/ethereum.hex [Install] WantedBy=multi-user.targetSee more flags at https://nimbus.guide/options.html
-
Press
CTRL+XthenYthenENTERto save and exit the config file.
-
-
Load changes
sudo systemctl daemon-reload -
Start the Beacon chain service
sudo systemctl start eth-nimbusbeacon -
Check the service
systemctl status eth-nimbusbeaconjournalctl -fu eth-nimbusbeacon -
Start the service automatically on system startup
sudo systemctl enable eth-nimbusbeaconNote
This option requires the following installed utils:
A guide to install the util is attached on the Github.
- Open Delayed Start shell
sudo nano /usr/local/bin/delayed-start.shConfigurate service start inside it
systemctl start eth-nimbusbeacon.service - Be sure,
delayed-start.serviceservice controllingdelayed-start.shis enabled for auto start with system startupsudo systemctl enable delayed-start.service
NOTE: This option requires following installed utils: A guide to install each util is attached on the Github.
Configurate Staking Manager util
- Open the configuration file
sudo nano /usr/local/etc/staking/config/clients.confIf the file is empty, generate it with command
sudo /usr/local/bin/staking.sh init - Set link to proper services. It should be as follow:
beaconServices="eth-nimbusbeacon.service"
- Open the configuration file
-
Activate service to start automatically on OS startup
- Open Start with delay util
sudo nano /usr/local/bin/delayed-start.sh - Place or uncomment a command to start the Beacon client(s)
/usr/local/bin/staking.sh start beacon - Verify, that a service `delayed-start.service` exists and is automatically launched on system start.
sudo systemctl enable delayed-start.service
- Open Start with delay util
- Open Delayed Start shell