1
sudo addgroup --system monero
sudo adduser --system --home /var/lib/monero --ingroup monero --disabled-login monero
2
wget https://downloads.getmonero.org/linux64
tar -xjvf linux64
sudo mv monero-x86_64-linux-gnu-v*/* /usr/local/bin/
Create the Hardened Config (/etc/monerod.conf)
# Data & Logs
data-dir=/var/lib/monero
log-file=/var/log/monero/monero.log
log-level=0
# P2P Network (Discovery)
p2p-bind-ip=0.0.0.0
p2p-bind-port=18080
# RPC (Public Access - Hardened)
public-node=1
restricted-rpc=1
rpc-bind-ip=0.0.0.0
rpc-bind-port=18089
confirm-external-bind=1
# Performance & Security
no-igd=1 # Disable UPnP
enable-dns-blocklist=1 # Block known malicious nodes
prep-hugepages=1 # Optimization for mining
# prune-blockchain=1 # Uncomment if storage is <200GB
Phase 3: Setup as a Systemd Service
Create /etc/systemd/system/monerod.service:
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable monerod
sudo systemctl start monerodTo maximize your growth as a professional in this space, we are shifting from "tinkering" to "infrastructure as code." This is a definitive, end-to-end deployment guide for a hardened, headless Monero node on your Debian 12 VM.
Follow these steps in exact order.
Phase 1: VirtualBox Preparation
Before you hit "Start" on the VM:
Network: Change "Attached to" from NAT to Bridged Adapter. This allows the node to have a unique IP on your network.
Processor: Allocate at least 4 cores. Check Enable Nested VT-x/AMD-V.
Storage: Ensure you have a 250GB+ Fixed-size VDI.
Phase 2: OS Installation (The Clean Base)
Boot the
.Debian ISO During Software Selection:
Uncheck:
Debian desktop environmentandGNOME.Check:
SSH serverandstandard system utilities.
Finish install and reboot.
Phase 3: System Hardening (Post-Install)
Login directly to the VM console once, then move to your host terminal (SSH).
1. Identify IP and Connect via SSH
ip a # Note the IP address, e.g., 192.168.1.50
On your Host (Windows/Mac) terminal:
ssh your_username@192.168.1.50
2. Update and Install Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y ufw curl wget tar bzip2 git prometheus grafana tor
3. Configure Firewall (The Perimeter)
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh # Port 22
sudo ufw allow 18080 # Monero P2P
sudo ufw allow 18089 # Restricted Public RPC
sudo ufw allow 37889 # P2Pool P2P
sudo ufw enable
Phase 4: Monero Node Deployment
We will create a dedicated service user and automate the daemon.
1. Create Service User
sudo addgroup --system monero
sudo adduser --system --home /var/lib/monero --ingroup monero --disabled-login monero
2. Install Monero Binaries
mkdir ~/monero-build && cd ~/monero-build
wget -O monero.tar.bz2 https://downloads.getmonero.org/cli/linux64
tar -xjvf monero.tar.bz2
sudo mv monero-x86_64-linux-gnu-v*/monerod /usr/local/bin/
sudo chown monero:monero /usr/local/bin/monerod
3. Create Configuration (/etc/monero.conf)
sudo nano /etc/monero.conf
Paste this:
data-dir=/var/lib/monero
log-file=/var/log/monero/monero.log
log-level=0
public-node=1
restricted-rpc=1
rpc-bind-ip=0.0.0.0
rpc-bind-port=18089
confirm-external-bind=1
prep-hugepages=1
no-igd=1
4. Setup Systemd Service
sudo nano /etc/systemd/system/monerod.service
Paste this:
[Unit]
Description=Monero Full Node
After=network.target
[Service]
User=monero
Group=monero
ExecStart=/usr/local/bin/monerod --config-file /etc/monero.conf --non-interactive
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now monerod
Phase 5: P2Pool Mining (Decentralized Hashpower)
1. Download P2Pool
cd ~/monero-build
wget https://github.com/SChernykh/p2pool/releases/latest/download/p2pool-linux-x64.tar.gz
tar -xzvf p2pool-linux-x64.tar.gz
sudo mv p2pool /usr/local/bin/
2. Start P2Pool (Replace address with your XMR wallet)
# It's best to run this as a service too, but for testing:
p2pool --host 127.0.0.1 --wallet YOUR_ADDRESS_HERE --mini
Phase 6: Monitoring (The Executive Dashboard)
Start Services:
Bashsudo systemctl enable --now prometheus sudo systemctl enable --now grafana-serverAccess Grafana: Open
http://192.168.1.50:3000in your browser.Connect Data: Add Prometheus (URL:
http://localhost:9090).Import: Use Dashboard ID
1860for system metrics.
Final Strategy for the Manager
Your node is now a "black box" that secures the network.
Next Level: Set up a cron job to run the
update-monero.shscript we discussed to ensure you never fall out of consensus.Opportunity Cost: Every hour this VM is off, you aren't just losing pennies in XMR; the network is losing a reliable validator. Keep it on 24/7.
Would you like me to write a one-line script to check your mining status from your phone via SSH?
No comments:
Post a Comment