Skip to content
atori.tech

3.3 Block explorer

Difficulty: Hard Tested v0.18.5.4

onion-monero-blockchain-explorer (xmrblocks) is a self-hosted Monero block explorer. It reads your node's database directly, so lookups never leave your home. It can also decode outputs with a view key and check payment proofs, all privately.

Why it's rated Hard

The explorer must be compiled against the Monero source code, so you build Monero too. This takes 30–90 minutes, needs ~4 GB of RAM (add swap if needed), and every Monero upgrade means rebuilding both. Sometimes the explorer lags behind new Monero releases.

Which versions work together

  • The explorer's master branch moved to Monero's development code (FCMP++) in late September 2026. It no longer compiles against any Monero release (see this open report).
  • The last commit written for today's network, 5d9e37c, also fixed the build for Ubuntu 26.04's CMake 4 and Boost 1.90. It needs Monero v0.18.5.1: v0.18.5.3 and later changed a function it uses (is_coinbase), so the build fails with them.
  • This guide pins that pair, the same one the explorer's own Dockerfile uses. Your node keeps running the newest monerod. The explorer only reads its database, whose format is the same across all v0.18 releases.

Requirements

  • 2.1 Monero node synced
  • ~10 GB of free disk space for the source code and build

Build dependencies

Install the packages from the Monero build guide for Ubuntu, as shown in the moneroexamples compilation guide. For Ubuntu 26.04:

sudo apt install -y build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev \
  libsodium-dev libunwind-dev liblzma-dev libreadline-dev libexpat1-dev libpgm-dev \
  libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev \
  libboost-all-dev libcurl4-openssl-dev libminiupnpc-dev git

libminiupnpc-dev is only needed by the explorer: Monero no longer bundles miniupnpc, and without it the explorer's last build step fails with No rule to make target 'Xmr_MINIUPNPC_LIBRARY-NOTFOUND'.

Preparations

The explorer is a web server that anyone on your network can reach (and anyone with its onion address, if you add one). So it doesn't run as monero, the user that owns your node's database and config: it gets its own user, xmrblocks, that can only read the blockchain.

sudo adduser --disabled-password --comment "" xmrblocks
sudo adduser xmrblocks monero

Membership of the monero group gives read access to /data/monero. One file needs more: every program that reads monerod's database records itself in the lock file lock.mdb, so the group must be able to write that one file:

sudo chmod g+w /data/monero/lmdb/lock.mdb
ls -l /data/monero/lmdb/lock.mdb
-rw-rw-r-- 1 monero monero 8192 Nov  4 14:16 /data/monero/lmdb/lock.mdb

The setting survives restarts of monerod and of the node. Only if the lmdb folder is deleted and the node syncs again (see 2.1 Troubleshooting) do you need to run the chmod again.

Build Monero and the explorer

Build as the xmrblocks user, in its home folder:

sudo su - xmrblocks

Build Monero v0.18.5.1, the version the explorer was written for (see Which versions work together above). The cmake step of the explorer looks for it in ~/monero by default:

git clone --recursive -b v0.18.5.1 https://github.com/monero-project/monero.git ~/monero
cd ~/monero
USE_SINGLE_BUILDDIR=1 make -j$(nproc)

Build the explorer, pinned to commit 5d9e37c:

cd ~
git clone https://github.com/moneroexamples/onion-monero-blockchain-explorer.git
cd onion-monero-blockchain-explorer
git checkout 5d9e37c
mkdir build && cd build
cmake ..
make -j$(nproc)
exit

Autostart on boot

sudo nano /etc/systemd/system/xmrblocks.service
# MoneroBox: systemd unit for the Monero block explorer
# /etc/systemd/system/xmrblocks.service

[Unit]
Description=Monero block explorer (xmrblocks)
Requires=monerod.service
After=monerod.service

[Service]
User=xmrblocks
Group=xmrblocks
# Read access to /data/monero through the monero group
SupplementaryGroups=monero
Type=simple
WorkingDirectory=/home/xmrblocks/onion-monero-blockchain-explorer/build
# The mempool page needs monerod's full RPC on 18081: the wallet port 18089
# doesn't serve get_transaction_pool.
ExecStart=/home/xmrblocks/onion-monero-blockchain-explorer/build/xmrblocks \
  --bc-path=/data/monero/lmdb \
  --daemon-url=http://127.0.0.1:18081 \
  --port=8081 \
  --enable-json-api \
  --enable-autorefresh-option
Restart=on-failure
RestartSec=30

# Hardening: the whole filesystem is read-only for the explorer, except
# the database lock file, which every reader of the database must write
ProtectSystem=strict
ProtectHome=read-only
ReadWritePaths=/data/monero/lmdb/lock.mdb
PrivateTmp=true
PrivateDevices=true
NoNewPrivileges=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX

[Install]
WantedBy=multi-user.target

Note

Run xmrblocks --help to check the options of the version you built. Add --enable-pusher to be able to broadcast signed transactions, or --enable-emission-monitor to track the total supply.

sudo systemctl daemon-reload
sudo systemctl enable --now xmrblocks
journalctl -fu xmrblocks

What the explorer can and can't do

  • It runs as xmrblocks, which can't write your node's database or monerod.conf. On top of that, systemd makes the whole filesystem read-only for it, except lock.mdb.
  • It still talks to monerod's full RPC on 127.0.0.1:18081, because the wallet port 18089 doesn't serve the mempool. That RPC can control monerod (for example stop it), so keep the explorer updated and its onion address private.

Check that it runs as its own user:

ps -o user=,cmd= -C xmrblocks
xmrbloc+ /home/xmrblocks/onion-monero-blockchain-explorer/build/xmrblocks --bc-path=/data/monero/lmdb ...

(ps shortens long user names with a +.)

Access

The explorer listens on all interfaces. Open its port in the firewall:

sudo ufw allow 8081/tcp comment 'Block explorer'

Open http://NODE_IP:8081 in your browser. Right after a start, the explorer needs about a minute before it answers.

On a pruned node

A pruned node keeps full transaction data only for the most recent ~5,500 blocks (about a week) and for 1/8 of older blocks. For the other transactions the explorer shows only Cant get tx: …. Blocks, the mempool and recent transactions work as usual.

Over Tor

Add another onion service in /etc/tor/torrc, like in 2.2:

HiddenServiceDir /var/lib/tor/xmrblocks/
HiddenServicePort 80 127.0.0.1:8081
Reload Tor (sudo systemctl reload tor) and read the address with sudo cat /var/lib/tor/xmrblocks/hostname. A new onion address can take a few minutes to answer.

Upgrade

The explorer doesn't have to match your monerod version: it only reads the database. Upgrade it when the explorer project publishes a commit for a newer Monero release. Check the commit history and issue #347 first, because master currently targets Monero's development code. Then, as xmrblocks (sudo su - xmrblocks):

  1. In ~/monero: git fetch --tags && git checkout vNEW && git submodule update --init --force, and rebuild it.
  2. In ~/onion-monero-blockchain-explorer: git fetch && git checkout NEW_COMMIT, and rebuild in build/.
  3. Restart xmrblocks.

A Monero network upgrade (hard fork) can change the database, so check the explorer before your node passes the fork height.

Troubleshooting

Failed to open lmdb environment: Permission denied / Error accessing blockchain

The explorer can't write the database lock file. This happens after the lmdb folder was deleted and the node synced again, which creates a new lock.mdb. Give the group write access again, then restart the explorer:

sudo chmod g+w /data/monero/lmdb/lock.mdb
sudo systemctl restart xmrblocks

Uninstall

sudo systemctl disable --now xmrblocks
sudo rm /etc/systemd/system/xmrblocks.service
sudo ufw delete allow 8081/tcp
sudo deluser --remove-home xmrblocks     # also deletes the Monero and explorer builds
sudo chmod g-w /data/monero/lmdb/lock.mdb

If you added the onion service, remove its block from /etc/tor/torrc, then run sudo systemctl reload tor and sudo rm -rf /var/lib/tor/xmrblocks.