In this guide, we will install and host our own Mempool Explorer. This is a valuable tool for looking up detailed information about blocks, addresses, balances, transactions and more; however, for privacy reasons, it’s preferable to host your own instance locally instead of entering personal transaction details into websites you don’t control.
Before installing Mempool, you must first install Docker Engine and Docker Compose. Docker is also required for our Dojo installation later in the guide.
First, you need to add the Docker repository and GPG key.
sudo apt-get update
sudo apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Now install Docker Engine and allow it to be managed by a non-root user.
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo usermod -aG docker $USER
This will end the SSH session. SSH back in again and check that Docker has been successfully installed using the following command.
This command usually shows a list of your installed Docker containers; however, since this is a fresh install, it will be completely blank.
You can check what version of Docker Engine you have installed with the following command.
Next, install “Docker Compose Standalone“. As of writing, the most recent version is 2.18.1.
sudo curl -SL https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
You can check that Compose has successfully been installed with the following command. The output should show the
Installing Mempool Explorer.
Start the Mempool installation process by cloning the repository.
git clone https://github.com/mempool/mempool.git
We need to make several edits to the “docker-compose.yml” file.
Edit the following lines.
####change ports: - 80:8080 ##to ports: - 4080:8080 ####change MEMPOOL_BACKEND: "none" ##to MEMPOOL_BACKEND: "electrum" ####edit to your nodes local ip CORE_RPC_HOST: "172.27.0.1" ####edit to your core rpc username & password CORE_RPC_USERNAME: "mempool" CORE_RPC_PASSWORD: "mempool" ####change all 3 instances of restart: on-failure ##to restart: always
Create a space below “STATISTICS_ENABLED” and paste the following lines. Tidy it up to match the formatting of the entries above, then edit the “ELECTRUM_HOST” line to include your node’s local IP address.
ELECTRUM_HOST: "your.nodes.ip.address" ELECTRUM_PORT: "50002" ELECTRUM_TLS_ENABLED: "true"
Scroll down to the next empty line at the bottom of the file, then paste the following block exactly as shown.
networks: default: driver: bridge ipam: config: - subnet: 172.16.57.0/24
You can now save and exit the file. Next, initialise Mempool.
docker-compose up -d
Test that your Mempool installation is running by visiting your node’s local IP address in a web browser, using port 4080, for example;
You should now land on your own local deployment of Mempool. Since this is a fresh install, it may take time before Mempool fully populates, so don’t be concerned if the dashboard is missing data.
Accessing Mempool Remotely
Even though it’s the simplest and most effective method, I strongly advise against using port forwarding to expose your Mempool port to the public internet. Instead, I recommend connecting remote devices to your home network using a VPN tunnel. Some routers have this ability built-in, but for those that don’t, I recommend trying Tailscale, which can be installed on up to 20 separate devices, linking them together via Wireguard.
First, head to Tailscale and create a free account using either your Github account or an anonymous Google/Microsoft account.
Once you have signed up, you will be prompted to add your first device. First, install Tailscale on your node by running the following command via SSH.
curl -fsSL https://tailscale.com/install.sh | sh
Once installed, run the following command to start Tailscale.
sudo tailscale up
A URL will be displayed in the output. Open this link in a browser and accept the connection request to link your node with the Tailscale service.
You can then connect any remote devices that require Mempool access. Install instructions for non-Linux devices can be found here.
Once you have connected all devices, head over to your Tailscale account and copy the displayed IPV4 address for your node in the “Machines” list. You can then access your Mempool from any of these connected devices by using the copied IP and adding port 4080 at the end, for example;
Tailscale is an incredibly useful tool for many different usecases. For more detailed information, I recommend checking out their official documentation.
In the next article, we will install a Samourai Wallet Dojo server.