Introduction
Now is the good time to learn how to run validator on NEAR!


Sooo, In this guide, I’ll show you how to run a validator on the NEAR mainnet. This easy, step-by-step guide will help you quickly join and validate the NEAR network, contribute to its decentralization and resilience, and earn validator rewards along the way!
As a NEAR community member, I’ve been running a NEAR node for over two years, starting with Stake Wars 3 (2022). In this guide, I’ll provide you with a detailed, step-by-step tutorial so you can set up your own NEAR full node based on my experience all these years!
I’m excited to share everything I’ve learned, offering clear, detailed instructions to guide you through the process of setting up your own validator node on NEAR! Let’s reach 1000 active validators on NEAR!
Why should you run a NEAR node?
NEAR is the blockchain with a huge amount of activities in web3 space but the minimum requirement for running a node is relatively lightweight, cheap to run, and much easier to maintain compared to other networks.
Top blockchains by activities, source: Artemis.
And here is the minimum hardware requirement for running a node on some popular chains (by network activities)

Basically the requirement for NEAR node is like a consumer laptop that you can find in pretty much anywhere (it’s would better to run on a gaming laptop IMHO 😆).
The cool thing about NEAR is that you don’t need a mainframe (> 512GB ram, 300TB disk space) or even have to set up a whole database center to run and you actually can be profitable without the Foundation cover basis cost, unlike other chains!
Of course, for the node, the powerful machine, the better it performs!
I personally run my node in a machine with 32gb of RAM and 2TB NVME SSD on 12 CPU cores, which costs around 60$/month.
Other reasons are when you need to run applications that heavily depend on RPC performance and/or availability, develop and deploy contracts on a local (independent and isolated) node (sometimes called “localnet”) or quickly extract blockchain data that can be used for chain analytics, block explorer, etc…
That’s pretty much reason to be bullish 🐂 on running a NEAR node, so we start now!
Installation
Requirements
- You can use any Linux distribution but for this guide I will use Ubuntu, the requirement for Ubuntu version is 20.04 or newer, mine is running 22.04
- Minimum hardware requirement:
- 8GB of RAM (recommended 16gb+)
- ~960 GB of NVME SSD
- CPU with 8 cores, CPU features: CMPXCHG16B, POPCNT, SSE4.1, SSE4.2, AVX, SHA-NI
- 1Gbit network bandwidth.
Setup
Setup NEAR mainnet
You will need a NEAR address for running the node, this address will also get network rewards for running an active validator.
- Create a FREE named NEAR address here: https://wallet.meteorwallet.app I created lncvalidator.near for this guide
- Deposit around 31 NEAR to the address, 30 NEAR needed for creating the staking pool and will be locked for storage
- Import the account to https://app.mynearwallet.com/
Install libraries and Nearcore
Now is the fun part, let’s setup the NEAR node, login to your server and run the following commands first to update OS, install tools and libraries (near-cli, node, Python, Git, docker…).
Please note: All commands in this guide will be needed to run under root user!
sudo apt update && sudo apt upgrade -y && sudo apt install -y git binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev cmake gcc g++ python3 docker.io protobuf-compiler libssl-dev pkg-config clang llvm awscli tmux jq ccze rclone
Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustup -V
During the installation, if asked, just press Yes and default for everything!
Install NEAR Rust CLI and NEAR-Validator extension
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/latest/download/near-cli-rs-installer.sh | sh && curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near-cli-rs/near-validator-cli-rs/releases/latest/download/near-validator-installer.sh | sh && source $HOME/.cargo/env
Clone the nearcore repo, choose the latest stable branch for mainnet and build the nearcore from source
cd ~ && git clone https://github.com/near/nearcore && cd nearcore/ && git checkout <VERSION>
make release
echo 'export NEAR_ENV=mainnet' >> ~/.bashrc
source ~/.bashrc
for the <VERSION>, get the latest mainnet release version here: https://github.com/near/nearcore/releases, for example, the current version is 2.4.0, so the checkout command will become git checkout 2.4.0
This build process (make release) will take around 15 minutes, you need to wait for it before going to next commands.
Authorize wallet
near login
Note: This command launches a web browser allowing for the authorization of a full access key to be copied locally.
1 – Copy the link in your browser
2 – Grant Access to Near CLI, choose “Store the access key in my keychain” from the CLI command.
3 – After Grant, fill your validator address (lncvalidator.near in this case) and press Enter
Initialize & Start the Node
Definitions:
- <pool_id> or pool_id – your pool name, for example lncvalidator
- <full_pool_id> or full_pool_id – xxx.poolv1.near, where xxx is your pool_id
- <accountId> or accountId – xxx.near where xxx your account name, for example lncvalidator.near
cd ~/nearcore && target/release/neard init --chain-id="mainnet" --account-id=<full_pool_id>
Set your <full_pool_id>, example: xxx.poolv1.near, where xxx is your pool_id, for example: lncvalidator.poolv1.near
validator_key.json generated after the above command in ~/.near/ folder must be something like this:
The account_id must match the staking pool contract id or you will not be able to sign/verify blocks.
Note: If your node has only less than 1TB disk space, you will need to lower “epoch data to keep” to avoid disk full issue.
update ~/.near/config.json and reduce “gc_num_epochs_to_keep” to 3 instead of default 5:
Setup Systemd so the node will always run with the system
sudo nano /etc/systemd/system/neard.service
Paste:
Description=NEARd Daemon Service [Service] Type=simple User=root WorkingDirectory=/root/.near ExecStart=/root/nearcore/target/release/neard run Restart=on-failure RestartSec=30 KillSignal=SIGINT TimeoutStopSec=45 KillMode=mixed [Install] WantedBy=multi-user.target
After that, enable the service:
sudo systemctl enable neard
Sync data using NEAR Peer-to-peers state sync:
NEAR has decentralized state sync, a torrent like protocol for nodes to sync data with each others without relies on snapshot providers, to sync with p2p state sync, you would need to get the latest boot nodes list from the NEAR network and update to config.json file and then start the neard service, here is the command:
curl -s -X POST https://rpc.mainnet.near.org -H "Content-Type: application/json" -d '{ "jsonrpc": "2.0", "method": "network_info", "params": [], "id": "dontcare" }' | \ jq --arg newBootNodes "$(curl -s -X POST https://rpc.mainnet.near.org -H "Content-Type: application/json" -d '{ "jsonrpc": "2.0", "method": "network_info", "params": [], "id": "dontcare" }' | jq -r '.result.active_peers as $list1 | .result.known_producers as $list2 | $list1[] as $active_peer | $list2[] | select(.peer_id == $active_peer.id) | "\(.peer_id)@\($active_peer.addr)"' | paste -sd "," -)" \ '.network.boot_nodes = $newBootNodes' ~/.near/config.json > ~/.near/config.tmp && mv ~/.near/config.json ~/.near/config.json.backup && mv ~/.near/config.tmp ~/.near/config.json
after that, just restart the node ( sudo systemctl restart neard
) and you will see something like this:
Wait for sometime (maybe 2 to 5 hours) and you are done, follow the next step to become an active validator!
Sync data with snapshot:
As an alternative method, we can download the snapshot of recent NEAR epochs instead of waiting for node sync with other peers, This process will take a few hours, and the expected data size will be around 580GB.
Run this to download snapshot and start the node (huge thanks FastNEAR for maintaining this):
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/fastnear/static/refs/heads/main/down_rclone.sh | DATA_PATH=~/.near/data CHAIN_ID=mainnet RPC_TYPE=fast-rpc bash && sudo systemctl restart neard
The command will sync data and restart the neard!
If you need to make a change to service in the config.json file, the node also need to be reloaded:
sudo systemctl restart neard
Watch logs
Command:
journalctl -n 100 -f -u neard | ccze -A
Check the running status of the validator node. If you see something like the image above, it means the node is fully synced, and you are ready to become an active validator!
Becoming an active Validator
In order to become a validator and enter the validator set to help secure the network and earn rewards, a minimum set of success criteria must be met:
- The node must be fully synced
- The validator_key.json must be in place
- The contract must be initialized with the public_key in validator_key.json
- The account_id must be set to the staking pool contract id
- There must be enough delegations to meet the minimum seat price. See the seat price here or just run this command
near-validator validators network-config mainnet next
- A proposal must be submitted by pinging the contract
- Once a proposal is accepted a validator must wait 2-3 epoch to enter the validator set
- Once in the validator set the validator must produce great than 90% of assigned blocks or your node will be kick out
Check the running status of the validator node. If “Validator” is showing up, your pool is selected in the current validators list.
Deploy your staking pool contract
NEAR uses a staking pool factory with a whitelisted staking contract to ensure delegators’ funds are safe. In order to run a validator on NEAR, a staking pool must be deployed to a NEAR account and integrated into a NEAR validator node. Delegators must use a UI or the command line to stake to the pool. A staking pool is a smart contract that is deployed to a NEAR account.
Note: STAKING POOL CONTRACT WONT HAVE WRITE ACCESS TO ALL SUB ACCOUNTS FUNDS OR DATA, this also applies for any sub accounts on NEAR, that means your staking balance is SAFU!
Deploy a Staking Pool Contract
Calls the staking pool factory, creates a new staking pool with the specified name, and deploys it to the indicated accountId.
For Mainnet
near contract call-function as-transaction poolv1.near create_staking_pool json-args '{"staking_pool_id": "<pool_id>", "owner_id": "<accountId>", "stake_public_key": "<public_key>", "reward_fee_fraction": {"numerator": 5, "denominator": 100}}' prepaid-gas '100.0 Tgas' attached-deposit '30 NEAR' sign-as <accountId> network-config mainnet sign-with-keychain
From the example above, you need to replace:
- pool_id: Staking pool name
example “lncvalidator” - owner_id:: The NEAR account that will manage the staking pool. Usually your main NEAR account.
- public_key: The public key in your validator_key.json file.
- 5: The fee the pool will charge (e.g. in this case 5 over 100 is 5% of fees), usually validators take 5% fee, if you set the fee so high, no one will stake to your node 😉
- accountId: The NEAR account deploying the staking pool.
Be sure to have at least 30 NEAR available, it is the minimum required for storage.
Final command will look something like this:
near contract call-function as-transaction poolv1.near create_staking_pool json-args '{"staking_pool_id": "lncvalidator", "owner_id": "lncvalidator.near", "stake_public_key": "ed25519:A9RdmNFxxx", "reward_fee_fraction": {"numerator": 5, "denominator": 100}}' prepaid-gas '100.0 Tgas' attached-deposit '30 NEAR' sign-as lncvalidator.near network-config mainnet sign-with-keychain
To change the pool parameters, such as changing the amount of commission charged to 1% in the example below, use this command:
near contract call-function as-transaction <full_pool_id> update_reward_fee_fraction json-args '{"reward_fee_fraction": {"numerator": 1, "denominator": 100}}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' sign-as <account_id> network-config mainnet sign-with-keychain
Note: full_pool_id: <pool_id>.poolv1.near , it’s lncvalidator.poolv1.near in this case
You will see something like this:
If there is a “True” at the End. Your pool is created.
Congrats! You have now configure your Staking pool up and running 🚀🚀🚀🚀
Manage your staking pool contract
Few useful commands you should know:
Retrieve the owner ID of the staking pool
near contract call-function as-read-only <full_pool_id> get_owner_id json-args {} network-config mainnet now
Issue this command to retrieve the public key the network has for your validator
near contract call-function as-read-only <full_pool_id> get_staking_key json-args {} network-config mainnet now
If the public key does not match you can update the staking key like this (replace the pubkey below with the key in your validator.json file)
near contract call-function as-transaction <full_pool_id> update_staking_key json-args '{"stake_public_key": "<public key>"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' sign-as <accountId> network-config mainnet sign-with-keychain
Working with Staking Pools
NOTE: Your validator must be fully synced before issuing a proposal or depositing funds.
Proposals and Pings
In order to get a validator seat you must first submit a proposal with an appropriate amount of stake. Proposals are sent for epoch +2. Meaning if you send a proposal now, if approved, you would get the seat in 3 epochs. You should submit a proposal every epoch to ensure your seat. To send a proposal we use the ping command. A proposal is also sent if a stake or unstake command is sent to the staking pool contract.
To note, a ping also updates the staking balances for your delegators. A ping should be issued each epoch to keep reported rewards current on the pool contract. You could set up a ping using a cron job with a ping script here.
Create a new file on /home/root/scripts/ping.sh and fill this:
#!/bin/sh # Ping call to renew Proposal added to crontab export NEAR_ENV=mainnet export LOGS=/home/root/logs export POOLID=<full_pool_id> export ACCOUNTID=<account_id> echo "---" >> $LOGS/all.log date >> $LOGS/all.log near contract call-function as-transaction $POOLID ping json-args '{"stake_public_key": "<public key>"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' sign-as $ACCOUNTID network-config mainnet sign-with-keychain >> $LOGS/all.log
Create logs folder:
mkdir $HOME/logs
Change execute permission for ping.sh file:
chmod +x $HOME/scripts/ping.sh
Create a new crontab, I personally setup it to run running every 8 hours:
crontab -e
Fill this and save
0 */8 * * * sh /home/root/scripts/ping.sh
List crontab to see it is running:
crontab -l
Review your logs
cat $HOME/logs/all.log
That is it, now you need to have enough delegated tokens to be an active validator, welcome to decentralized NEAR Protocol and earning rewards along the way 🚀🚀🚀🚀 💪💪💪💪 🛳️🛳️🛳️👽👽👽🛸🛸🛸
Network optimizations
To optimize the network settings for better validator performance, execute the following commands:
MaxExpectedPathBDP=8388608 sudo sysctl -w net.core.rmem_max=$MaxExpectedPathBDP sudo sysctl -w net.core.wmem_max=$MaxExpectedPathBDP sudo sysctl -w net.ipv4.tcp_rmem="4096 87380 $MaxExpectedPathBDP" sudo sysctl -w net.ipv4.tcp_wmem="4096 16384 $MaxExpectedPathBDP" sudo sysctl -w net.ipv4.tcp_slow_start_after_idle=0
These changes do not persist across system restarts. To apply them automatically on boot, add the following in /etc/sysctl.d/local.conf:
net.core.rmem_max = 8388608 net.core.wmem_max = 8388608 net.ipv4.tcp_rmem = 4096 87380 8388608 net.ipv4.tcp_wmem = 4096 16384 8388608 net.ipv4.tcp_slow_start_after_idle = 0
Optional: Submitting Pool Information
Adding pool information helps delegators and also helps with outreach for upgrades and other important announcements: https://github.com/zavodil/near-pool-details.
The available fields to add are: https://github.com/zavodil/near-pool-details/blob/master/FIELDS.md.
The identifying information that validators need to provide are: name, description, url, telegram, twitter,…
Example commands:
Change validator name and description:
- Replace <full_pool_id> with your pool address, for example: lncvalidator.poolv1.near
- Replace <accountId> with your authenticated wallet address, lncvalidator.near for this case
near contract call-function as-transaction pool-details.near update_field json-args '{"pool_id": "<full_pool_id>", "name": "name", "value": "LearnNEARClub"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' sign-as <accountId> network-config mainnet sign-with-keychain near contract call-function as-transaction pool-details.near update_field json-args '{"pool_id": "<full_pool_id>", "name": "description", "value": "LearnNEARClub Validator!"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' sign-as <accountId> network-config mainnet sign-with-keychain
View your validator infos from CLI:
near contract call-function as-read-only pool-details.near get_fields_by_pool json-args '{"pool_id":"<full_pool_id>"}' network-config mainnet now
View validator infos on NEARScope or NEARBlocks:
The info will show like this: (source: NearScope)
Maintaining the node
it’s important to maintain your node and keep it running stable, here is a few important things you need to know
Node status codes
- RED: update your node ASAP!!1!!!, something critical happended, I repeat, update-it-AS-SOON-AS-POSSIBLE!!
- YELLOW: you need to update the node, but it is not too urgent for now.
Find our more here: https://near-nodes.io/maintenance/maintenance#runtime-alerts
NEAR Validator community on Telegram
Join the group to get node update, supports and mores, please use this group for questions and discussions related to running a validator on NEAR
https://t.me/near_validators
Update new node version
When there is a new node version, you will get a notification on the Telegram Validator group, run this command to update the node.
cd ~/nearcore && git fetch && export NEAR_RELEASE_VERSION=<node_version> && git checkout $NEAR_RELEASE_VERSION && make release && sudo systemctl stop neard && sudo systemctl start neard
Replace <node_version> with the correct nearcore release version.
Monitor the node performance
Monitor the node in a Pro way:
https://near-nodes.io/validator/validator-bootcamp#grafana
Monitor the node in a degen way:
I created a small bot to help you quickly monitor the validator uptime here, you can take a look:
https://x.com/cuongdc_real/status/1839769081723138239
Withdraw your rewards
Basically just login to any wallet on NEAR and claim your validator rewards at the wallet staking section.
Useful commands
Few other useful commands you should know:
- Get list of active validators and the current seat price, their current performance:
near-validator validators network-config mainnet now
- Next validators list:
near-validator validators network-config mainnet next
- View validator staked balance:
near-validator staking view-stake <full_pool_id> network-config mainnet now
Basically just login to any wallet on NEAR and claim your validator rewards at the wallet staking section.
Resources
- NEAR Validators concept: https://docs.near.org/concepts/basics/validators
- NEAR Nodes – The official NEAR Validator docs that every validators should take a look: https://near-nodes.io/
- Calculate NEAR staking rewards: https://www.stakingrewards.com/asset/near-protocol
- NEAR Chain Status Twitter: https://x.com/NEARChainStatus
- View validators info on these websites
Conclusion
Thank you so much for reading this far! That’s everything I wanted to share about running a validator on NEAR.
In my experience, running a NEAR node is straightforward and almost bug-free, with far fewer issues compared to other high-activity chains. NEAR requires significantly fewer server resources due to its sharding with Nightshade. Plus, you earn rewards along the way!
Speaking of rewards, soon, NEAR validators will also have the opportunity to earn rewards for running the MPC network, which contributes to NEAR’s Chain Abstraction service for the broader Web3 ecosystem. With its vision of building the Open Web through Chain Abstraction and User-Owned AI, NEAR is poised to see even more network activity, giving validators the chance to earn additional rewards.
As a validator, your role is crucial in securing a high-performance network like NEAR. By safeguarding NEAR, you are also supporting many applications built on the network, such as Kaiching (a cashback app used by millions in Singapore), Sweatcoin (a health and fitness app with 100 million users worldwide), HOT (a Web3 wallet that serves as a gateway for new crypto users), and Ref Finance (a decentralized exchange on NEAR).
These apps serve millions of users daily, and as a validator, you’re essential in helping them maintain their services and grow!
Top comment
Validators play a pivotal role in the NEAR ecosystem, not just maintaining network security but also ensuring that innovative applications like Kaiching, Sweatcoin, HOT, and Ref Finance can operate reliably and scale effectively. Their work underpins the platform's performance and trustworthiness, essential for user adoption and the overall growth of the blockchain.
This is the best