2 min read

Mempool.space on Linux X86

Mempool.space on Linux X86

Preparation

Before we can start with the Mempool.space installation we have to install Docker, if not already installed.

sudo apt-get update 
sudo apt-get install git ca-certificates unzip curl gnupg lsb-release

Add the GPG keys

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Add the repo

sudo 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
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli docker-compose-plugin containerd.io

Check if everything is okay with docker

docker --version

You should see something like this

Docker version 20.10.21, build baeda1f

Add our user to the group docker

sudo usermod -aG docker $USER

We have to logout and login again.

Download Mempool.space

We are go into our homedirectory

cd ~/

Now we clone the Mempool.space Github repo.

git clone https://github.com/mempool/mempool

Set the correct parameters in the config file

cd mempool/docker

In this directory we find a file called docker-compose.yml. We open it with nano or any other editor.

nano docker-compose.yml

If we want to change the ports

ports:
  - 80:8080

Port 80 is the http standard port. If we want another port we can change it to 8181 or 4080 ...

ports:
  - 8181:8080

Under environment we have to set the backend to electrum

MEMPOOL_BACKEND: "none"
MEMPOOL_BACKEND: "electrum"

Now e have to add the electrum / fulcrum server config - copy and paste it

ELECTRUM_HOST: "192.168.100.242"
ELECTRUM_PORT: "50002"
ELECTRUM_TLS_ENABLED: "true"

Change the rpc parameter

CORE_RPC_HOST: "172.27.0.1"

Change to

CORE_RPC_HOST: "192.168.100.242"

(replace the 192.168.x.x with your ip-address)

In the next step we want to change the rpc_username

CORE_RPC_USERNAME: "mempool"

Change to

CORE_RPC_USERNAME: "nakamoto"

Change the password

CORE_RPC_PASSWORD: "mempool"

Change to

CORE_RPC_PASSWORD: "satoshi"

Now we have to change every on-failure to always.

restart: on-failure

Change to

restart: always

The configuration is done. We save the file with STRG +x +y +enter.

Start

To start our Mempool-space instance

docker compose up

We can reach our Mempool with the URL

http://192.168.100.242:8181

(replace the 192.168.x.x with your ip-address)

If everything is okay we can stop the service with STRG + c. To start it in the backup we use the following command

docker-compose up -d

Tor

So that our Mempool.space can also be reached externally, we can configure an onion address for it. We do this by going through these steps:

sudo nano /etc/tor/torrc

At the end we copy and paste

# Mempool Tor Service
HiddenServiceDir /var/lib/tor/mempool/
HiddenServiceVersion 3
HiddenServicePort 80 127.0.0.1:8181

Save the file with STRG +x +y +enter.

Restart the Tor service

sudo systemctl restart tor

To get the onion address for our Mempool.space

sudo cat /var/lib/tor/mempool/hostname

Done

From now on we have our own Mempool.space that we should always use.

๐Ÿงก
If this article was helpful for you, please consider a donation to the author.