Running a Monero (XMR) node is one of the most impactful ways to support the Monero network while enhancing your own financial privacy. Unlike lightweight wallets that rely on third-party servers, a self-hosted node lets you verify transactions independently, ensuring no one can spy on your activity. This guide walks you through setting up a Monero node, hardening it against attacks, and optimizing it for performance.
Why Run a Monero Node?
- Privacy: Avoid leaking transaction data to remote nodes.
- Decentralization: Strengthen the network by contributing to its resilience.
- Censorship Resistance: Help keep Monero accessible in restricted regions.
Step 1: Install Monero Software
Linux (Ubuntu/Debian)
- Add the Monero repository:
sudo apt install software-properties-common sudo add-apt-repository ppa:monero-project/monero sudo apt update
- Install
monerod
(the node software):sudo apt install monero
Windows/macOS
- Download the latest GUI wallet from getmonero.org.
- Check the “Advanced Mode” box and enable “Run a node” during setup.
Step 2: Configure Your Node
-
Create a Configuration File:
- Linux:
~/.bitmonero/bitmonero.conf
- Windows:
C:\ProgramData\bitmonero\bitmonero.conf
- Add these settings:
data-dir=/path/to/blockchain/storage # Use an SSD for faster sync rpc-bind-ip=127.0.0.1 # Restrict RPC to localhost confirm-external-bind=1 prune-blockchain=1 # Prune to reduce storage (~30GB vs. 140GB)
- Linux:
-
Start the Node:
monerod --config-file /path/to/bitmonero.conf
Step 3: Harden Security
A. Network Security
-
Firewall Rules: Block unnecessary ports. Monero uses port 18080 (P2P) and 18081 (RPC).
sudo ufw allow 18080/tcp # Allow P2P traffic sudo ufw deny 18081/tcp # Restrict RPC to localhost sudo ufw enable
-
Run Over Tor (Optional):
- Install Tor and configure
bitmonero.conf
:p2p-bind-ip=127.0.0.1 anonymous-inbound=127.0.0.1:18080,127.0.0.1:18081
- Add these lines to
/etc/tor/torrc
:HiddenServiceDir /var/lib/tor/monero-node/ HiddenServicePort 18080 127.0.0.1:18080
- Install Tor and configure
B. System Hardening
-
SSH Security:
- Disable root login and password authentication:
sudo nano /etc/ssh/sshd_config PermitRootLogin no PasswordAuthentication no
- Restart SSH:
sudo systemctl restart sshd
- Disable root login and password authentication:
-
Fail2Ban: Block brute-force attacks.
sudo apt install fail2ban sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
Add a Monero jail:
[monerod] enabled = true port = 18080 filter = monerod logpath = /var/log/monero/monerod.log
C. Privacy Best Practices
- VPN: Route node traffic through a no-logs VPN (e.g., Mullvad, ProtonVPN).
- Disk Encryption: Use LUKS (Linux) or BitLocker (Windows) to encrypt the blockchain storage drive.
- Run as Non-Root User:
sudo useradd -m monero sudo chown -R monero:monero /path/to/blockchain
Step 4: Optimize Performance
- Prune the Blockchain: Reduces storage to ~30GB.
monerod --prune-blockchain
- Use an SSD: Syncs the blockchain faster (~2 days vs. 1 week on HDD).
- Limit RPC Access: Disable RPC unless needed for wallets or monitoring.
Step 5: Monitor and Maintain
- Check Sync Status:
curl -X POST http://127.0.0.1:18081/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_info"}'
- Update Regularly:
sudo apt update && sudo apt upgrade monero
- Backup Wallet Files: Store
wallet.keys
andbitmonero.conf
offline.
Advanced: Run a Public Node (Optional)
To support the network:
- Allow incoming P2P connections:
p2p-bind-ip=0.0.0.0
- Advertise your node on moneronodes.com.
Common Mistakes to Avoid
- Exposing RPC Ports: Never leave port 18081 open to the internet.
- Ignoring Backups: Losing
wallet.keys
means losing access to funds. - Using Default Configs: Customize settings to minimize attack surfaces.
Conclusion: Your Node, Your Sovereignty
A properly secured Monero node not only protects your transactions but also fortifies the broader network against censorship. By following these steps, you’ll contribute to a future where financial privacy is accessible to all—not just the technically adept.
Note: Always test configurations in a safe environment before going live.