Blockchain Node Hosting on VPS
Blockchain Node Hosting on a VPS means running a blockchain node, which is a server that helps operate and verify a blockchain network like Ethereum, Geth and Erigon, Bitcoin Core on a VPS instead of your own hardware. This Blockchain Node Hosting VPS Tutorial shows you how to install and manage blockchain nodes on a fresh Ubuntu VPS for Web3 and cryptocurrency projects.
If you need a powerful and high-performance VPS which optimized for blockchain workloads, you can check PerLod Hosting.
Table of Contents
Install and Manage Blockchain Nodes on VPS
In this guide, we will use Ubuntu LTS, like Ubuntu 24.04 or Ubuntu 22.04, to run an Ethereum and a Bitcoin Core node. Here are the hardware recommendations for Blockchain Node Hosting VPS Tutorial:
- For production RPC nodes, use a VPS with NVMe storage, fast SSDs, 8–16 CPU cores, and 32–64 GB of RAM.
- For lighter or standard nodes, you can use 4 CPU cores, 16 GB of RAM, and 1–2 TB of NVMe storage.
Prepare the System for Blockchain Node Hosting VPS Tutorial
The first step is to prepare the OS, like installing essential tools, configuring firewall rules, and disk partitioning.
Run the system update and upgrade, then install the required tools and packages with the commands below:
sudo apt update && sudo apt upgrade -y
sudo apt install build-essential curl wget jq git ufw ca-certificates gnupg lsb-release -y
Create a dedicated user for blockchain nodes with the command below:
sudo adduser --disabled-password --gecos "" nodeuser
Optionally, if the user needs to run sudo commands, add the user to the sudo group:
sudo usermod -aG sudo nodeuser
Set the correct timezone on your system:
sudo timedatectl set-timezone UTC
When you want to run a blockchain node, it generates a huge amount of data, which can quickly crash a system’s main drive. Therefore, you must prepare a high-performance NVMe SSD, ensuring your node has the dedicated and fast storage it needs to operate reliably.
Create a single disk partition and then mount it to a directory, such as/var/lib/blockchain, using the commands below. We assume /dev/nvme1n1 is the data disk; please double-check the correct device name.
sudo mkdir -p /var/lib/blockchain
sudo parted /dev/nvme1n1 --script mklabel gpt mkpart primary 0% 100%
sudo mkfs.ext4 -F /dev/nvme1n1p1
sudo mount /dev/nvme1n1p1 /var/lib/blockchain
sudo chown nodeuser:nodeuser /var/lib/blockchain
Configure the system to automatically re-mount this disk after a reboot by adding it to the /etc/fstab file:
UUID=$(blkid -s UUID -o value /dev/nvme1n1p1)
echo "UUID=$UUID /var/lib/blockchain ext4 defaults,noatime 0 2" | sudo tee -a /etc/fstab
Finally, configure basic firewall rules with the commands below:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
Enable the firewall with the command below:
sudo ufw enable
Later, we will allow the specific node ports.
Run an Ethereum Node on a VPS
To run an Ethereum Node on a VPS, you can use two methods: Go Ethereum (Geth) and Erigon. Geth is best for a typical full node and moderate resource use, and for heavy-duty RPC providers and indexers, it is recommended to use Erigon.
Method 1. Install Geth Client for General-purpose
You can use the official Ethereum repository for a straightforward Geth client installation. Add the repository and install it with the following commands:
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt update
sudo apt install geth -y
Verify your installation by checking its version:
geth version
Note: If the PPA repository is not available on your system, download the binary from Go Ethereum and extract it.
Before running your node, you need to create a dedicated folder for the blockchain data. To do this, you can run the commands below:
sudo -u nodeuser mkdir -p /var/lib/blockchain/geth
sudo -u nodeuser geth --datadir /var/lib/blockchain/geth init /usr/share/geth/genesis.json #only for private chain; skip for mainnet
Then, run the Geth client with HTTP RPC enabled for local-only for a secure and efficient mainnet sync:
sudo -u nodeuser geth --datadir /var/lib/blockchain/geth \
--http --http.addr 127.0.0.1 --http.vhosts localhost \
--http.api eth,net,web3,personal \
--syncmode "snap" --cache=4096
To ensure your node runs continuously and restarts automatically after a reboot, you must configure it as a systemd service:
sudo nano /etc/systemd/system/geth.service
Add the following config to the file:
[Unit]
Description=Geth Ethereum node
After=network-online.target
[Service]
User=nodeuser
Group=nodeuser
Type=simple
ExecStart=/usr/bin/geth --datadir /var/lib/blockchain/geth --syncmode snap --http --http.addr 127.0.0.1 --http.vhosts=localhost --http.api eth,net,web3 --cache=4096
Restart=always
RestartSec=5
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
Apply the system changes and enable the Geth service with the commands below:
sudo systemctl daemon-reload
sudo systemctl enable --now geth
To check Geth service logs, you can use the following command:
sudo journalctl -u geth -f
Note: If you run a production RPC node, make sure it’s securely exposed to the internet. You can use a reverse proxy, enable TLS, and add authentication. The official Geth documentation explains how to set the right flags and how to connect a consensus client if you’re running a validator after the Ethereum Merge.
Method 2. Install Erigon Client for Heavy RPC and Indexing
For advanced indexing and performance, you can install Erigon by downloading the latest pre-compiled binary directly from the project’s GitHub releases. To do this, you can run the following commands as your nodeuser:
cd /home/nodeuser
wget https://github.com/ledgerwatch/erigon/releases/download/vX.Y.Z/erigon-linux-amd64.tar.gz
tar -xzf erigon-linux-amd64.tar.gz
sudo mv erigon*/build/bin/erigon /usr/local/bin/erigon
Once you are done, verify the Erigon installation by checking its version:
erigon --version
Now you can run Erigon with a common configuration that saves disk space and sets up the HTTP-JSON RPC API:
sudo -u nodeuser mkdir -p /var/lib/blockchain/erigon
sudo -u nodeuser erigon --datadir=/var/lib/blockchain/erigon --chain=mainnet --http --http.api=eth,debug,net,web3 --prune=some
Create a systemd service similar to the one used for Geth, but change the command to start Erigon instead:
ExecStart=/usr/local/bin/erigon...
Note: Erigon supports features like snapshots and pruning, and it usually runs with a larger cache and more threads for better performance. Check the Erigon documentation to see the recommended resource settings for your system.
Run a Bitcoin Full Node on a VPS
Bitcoin Core fully checks all transactions and connects to other nodes in the Bitcoin network. According to the official guidance, you will need:
- At least 500 GB of disk space (the blockchain is now over 500 GB).
- A fast internet connection.
- At least 2 GB of RAM.
Use the official Bitcoin repository to install the Bitcoin Core client:
sudo apt install gnupg -y
wget -qO - https://www.bitcoin.org/laanwj-releases.asc | sudo gpg --dearmour -o /usr/share/keyrings/bitcoin-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/bitcoin-archive-keyring.gpg] https://ppa.launchpadcontent.net/bitcoin/bitcoin/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/bitcoin.list
sudo apt update
sudo apt install bitcoind -y
Verify the Bitcoin Core installation by checking its version:
bitcoind --version
Then, create a configuration file to define how your node operates, including controlling essential settings like data location, RPC authentication, and whether to index all transactions:
sudo nano ~/.bitcoin/bitcoin.conf
Add the following configuration to the file:
# Example bitcoin.conf
server=1
daemon=1
txindex=1 # enable if you need transaction index/RPC queries
rpcuser=bitcoinrpc
rpcpassword=$(xxd -l 16 -p /dev/urandom)
rpcallowip=127.0.0.1
rpcport=8332
listen=1
maxconnections=40
datadir=/var/lib/blockchain/bitcoin
Enable the bitcoind system service and check the logs with the commands below:
sudo systemctl enable --now bitcoind
sudo journalctl -u bitcoind -f
Note: If you are limited on disk space, you can configure your node in bitcoin.conf file to prune old blockchain data:
prune=550 # keep ~550MB? (number is MB of block files) — choose carefully
Remember that pruning disables txindex and some RPC features; choose based on your use case.
Secure RPC Endpoints via Nginx Reverse Proxy
RPC Endpoints allow applications to send commands and request data from the node, such as checking a balance or broadcasting a transaction, so it becomes a primary attack vector. Never expose it directly to the internet and always bind it to localhost and use a secure reverse proxy if external access is required.
Also, allow the necessary ports through your firewall and keep all other ports locked down by default:
# Ethereum p2p
sudo ufw allow 30303/tcp
sudo ufw allow 30303/udp
# Bitcoin p2p
sudo ufw allow 8333/tcp
For safe remote access to the RPC API, you can use Nginx reverse proxy, which allows you to add essential layers of security like TLS encryption, password authentication, and rate limiting. For example:
server {
listen 443 ssl;
server_name eth-rpc.example.com;
ssl_certificate /etc/ssl/fullchain.pem;
ssl_certificate_key /etc/ssl/privkey.pem;
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://127.0.0.1:8545;
proxy_set_header Host $host;
}
}
Set Up Blockchain Node Monitoring
To keep your blockchain node healthy, you can install a system monitoring tool that tracks server resources like CPU, memory, and disk usage.
Install Prometheus node_exporter on your VPS to collect system metrics and set up Prometheus to collect these metrics. If you want detailed blockchain data, you can use Geth with the –metrics option, or Erigon’s metrics endpoint.
For example, set up node_exporter with the commands below:
sudo wget https://github.com/prometheus/node_exporter/releases/download/v1.5.0/node_exporter-1.5.0.linux-amd64.tar.gz
sudo tar -xzf node_exporter-*.tar.gz
sudo mv node_exporter-*/node_exporter /usr/local/bin/
sudo useradd --no-create-home --shell /bin/false nodeusr
sudo tee /etc/systemd/system/node_exporter.service > /dev/null <<EOF
[Unit]
Description=Node Exporter
After=network.target
[Service]
User=nodeusr
ExecStart=/usr/local/bin/node_exporter
Restart=always
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now node_exporter
For comprehensive monitoring, you can collect and analyze your node’s logs by setting up centralized logging, which helps you quickly diagnose issues like disk errors or synchronization problems.
Tip: If you need more advanced monitoring and alerting rules, you can check this guide on Linux Server Performance Monitoring with Prometheus.
Essential Blockchain Node Management Commands
To keep your node running smoothly, you can check synchronization status, monitor disk space, and diagnose common performance issues.
You can use the following command to verify that your Geth node is properly synced with the blockchain network:
curl -s --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' -H "Content-Type: application/json" http://127.0.0.1:8545 | jq
Check Bitcoin status with the following command:
bitcoin-cli -datadir=/var/lib/blockchain/bitcoin getblockchaininfo
Also, you must regularly check your disk space to avoid running out of storage:
df -h /var/lib/blockchain
du -sh /var/lib/blockchain/*
Note: Blockchain nodes often need to maintain many network connections simultaneously. If you see errors about “too many open files,” increase your system’s file handle limit in systemd or /etc/security/limits.conf.
FAQs
What is a blockchain node?
A blockchain node is a computer that connects to a blockchain network to store, validate, and broadcast transaction data, which ensures the network remains decentralized and secure.
What are the minimum system requirements for running a blockchain node?
For most full nodes, you will need at least 4 CPU cores, 16 GB RAM, and 1–2 TB of fast NVMe storage.
Can I run multiple blockchain nodes on one VPS?
Yes, but only if your server has sufficient CPU, memory, and disk space. Isolate each node’s data directory and port to prevent conflicts.
Conclusion
By following the Blockchain Node Hosting VPS Tutorial, you have learned to install, configure, secure, and monitor your blockchain node on a VPS environment. For the best performance and reliability, you can host your blockchain infrastructure on PerLod VPS Hosting Solutions.
We hope you enjoy this guide. Subscribe to our X and Facebook channels to get the latest updates and articles on Blockchain tutorials.
For further reading: