Storage Nodes are the foundation of 0G's decentralized storage while validator nodes secure the chain, storage nodes keep critical data persistent, available, and distributed. Running a storage node means you’re actively supporting the network’s long-term AI dataset and model hosting capabilities, contributing to resilience and decentralization.
Before You Begin:
- Add the 0G Galileo Testnet: Instructions here
- Request testnet tokens: 0G Faucet
Update & upgrade:
sudo apt-get update && sudo apt-get upgrade -yEssential packages:
sudo apt install curl iptables build-essential git wget lz4 jq make protobuf-compiler cmake gcc nano automake autoconf tmux htop nvme-cli libgbm1 pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev screen ufw -ycurl https://sh.rustup.rs -sSf | shsource $HOME/.cargo/envCheck Rust version:
rustc --versionwget https://go.dev/dl/go1.24.3.linux-amd64.tar.gz && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf go1.24.3.linux-amd64.tar.gz && \
rm go1.24.3.linux-amd64.tar.gz && \
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc && \
source ~/.bashrcCheck Go version:
go versionClone the repo:
git clone https://github.com/0glabs/0g-storage-node.gitSwitch to the latest release & update submodules:
cd 0g-storage-node && git checkout v1.1.0 && git submodule update --initCompile in release mode:
cargo build --releaseClear previous config (if any):
rm -rf $HOME/0g-storage-node/run/config.tomlDownload the config file:
curl -o $HOME/0g-storage-node/run/config.toml https://raw.githubusercontent.com/Mayankgg01/0G-Storage-Node-Guide/main/config.tomlAdd your wallet's private key: Important: Exclude the "0x" prefix!
Open the config for editing and enter your key under miner_key:
nano $HOME/0g-storage-node/run/config.toml- Find available RPC endpoints: Astrostake RPC List
- Update the RPC in your config:
Create a service file:
sudo tee /etc/systemd/system/zgs.service > /dev/null <<EOF
[Unit]
Description=ZGS Node
After=network.target
[Service]
User=$USER
WorkingDirectory=$HOME/0g-storage-node/run
ExecStart=$HOME/0g-storage-node/target/release/zgs_node --config $HOME/0g-storage-node/run/config.toml
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOFsudo systemctl daemon-reload
sudo systemctl enable zgs
sudo systemctl start zgs
Check service status:
sudo systemctl status zgsFollow logs live:
tail -f ~/0g-storage-node/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d)Check sync and block status:
while true; do response=$(curl -s -X POST http://localhost:5678 -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"zgs_getStatus","params":[],"id":1}'); logSyncHeight=$(echo $response | jq '.result.logSyncHeight'); connectedPeers=$(echo $response | jq '.result.connectedPeers'); echo -e "logSyncHeight: \033[32m$logSyncHeight\033[0m, connectedPeers: \033[34m$connectedPeers\033[0m"; sleep 5; doneStop & disable:
sudo systemctl stop zgs
sudo systemctl disable zgs
sudo rm /etc/systemd/system/zgs.service
rm -rf $HOME/0g-storage-node- Block explorer: Explorer 1 | Explorer 2
- Miner details (append wallet address): Miner Details
- The process is identical for local PC and VPS—just follow all steps above.
- To restart your node the next day, simply run:
sudo systemctl restart zgsIf your VPS storage is full or you want a clean reset:
sudo systemctl stop zgs
sudo systemctl disable zgs
sudo rm /etc/systemd/system/zgs.service
rm -rf $HOME/0g-storage-node
Then restart from the repository clone step and don’t forget the latest snapshot for fast sync!
Happy coding! You’re now powering the future of decentralized storage. — Guide by Satyam Jha




