Skip to content

Instantly share code, notes, and snippets.

@kdmukai
Last active February 16, 2024 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdmukai/123d21d73475d96aa36d2e64bf30169d to your computer and use it in GitHub Desktop.
Save kdmukai/123d21d73475d96aa36d2e64bf30169d to your computer and use it in GitHub Desktop.
Create a mempool.space instance in Proxmox

Create a mempool.space instance in Proxmox

Create the CT

  • Debian 12 image
  • 4 CPU cores
  • 8GB disk in local-lvm
  • 4096 MB RAM, 0 MB swap

Enable ssh

nano /etc/ssh/sshd_config

# In sshd_config:
PermitRootLogin yes

Exit and save changes, restart ssh

/etc/init.d/ssh restart

Install docker

Modified from the steps here: https://docs.docker.com/engine/install/debian/

for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do apt-get remove $pkg; done
# Add Docker's official GPG key:
apt-get update
apt-get install ca-certificates curl gnupg -y
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
   tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
docker run hello-world

Clone the mempool.space project

apt install git -y
git clone https://github.com/mempool/mempool.git

Set permissions on dirs needed by the container

cd ~/mempool/docker
chown -R 1000:1000 mysql

Start the mempool.space container

cd ~/mempool/docker
docker compose up

If successful, the webserver will be running port 80

Shut down the container

docker compose down

Set up as a service to run automatically

nano /etc/systemd/system/mempool.service

# In the text editor:
[Unit]
Description=mempool
After=network.target

[Service]
WorkingDirectory=/root/mempool/docker
ExecStart=/usr/bin/docker compose up
TimeoutStopSec=30min
Restart=always
StandardOutput=append:/root/stdout.log
StandardError=append:/root/error.log

[Install]
WantedBy=multi-user.target

Load the new service and run:

systemctl enable elementsd
systemctl start elementsd

If you make further service config changes, load your new changes with:

systemctl daemon-reload

Set up logrotate

nano /etc/logrotate.d/mempool.conf

# config details
/root/*.log {
    minage 2
    rotate 6
    size 10M
    compress
    delaycompress
    endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment