The most secure and private way to use bitcoin is having your own Bitcoin node and you Electrum Personal Server. Here I will explain a simple way to have them running in minutes using docker containers.
Note: all in red inside the commands is what you should change.
Creating a docker network so bitcoin-core can eps can comunicate
docker network create bitcoin_network
replace bitcoin_network with the name of the network you want to create.
Creating Bitcoin core container
in this example all my bitcoin core files will be in /Volumes/Open/btc
docker run -d \
--name bitcoin \
--network bitcoin_network \
-p 8333:8333 \
-p 8332:8332 \
-v /Volumes/Open/btc:/bitcoin-data \
kylemanna/bitcoind:latest \
-printtoconsole \
-datadir=/bitcoin-data \
-conf=/bitcoin-data/bitcoin.conf
Here we have created a bitcoin core container with the name bitcoin, using all the files is /Volumes/Open/btc as bitcoin core folder, on the network bitcoin_network.
Creating Electrum Personal Server Container
Create the folder where you will store eps configuration files, you will need to create ‘Dockerfile’, ‘requirements.txt’ and ‘config.ini’
Create a Dockerfile with the content bellow:
FROM python:3.8-slim-buster
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
WORKDIR /eps/Volumes/Open/eps/Dockerfile
RUN git clone https://github.com/chris-belcher/electrum-personal-server .
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
RUN python setup.py install
COPY config.ini /etc/electrum-personal-server/config.ini
EXPOSE 50002
CMD ["electrum-personal-server"]
Now you need a file called requirements.txt
attrs==21.4.0
aiohttp==3.8.1
ecdsa==0.17.0
pycryptodomex==3.11.0
at last you will need a config.ini file, this file contains the settings to connect to bitcoin core container.
[bitcoin-rpc]
host = bitcoin
port = 8332
rpc_user = bitcoincoreuser (set in bitcoin.conf)
rpc_password = bitcoincorepass (set in bitcoin.conf)
finally build your docker image called my-eps
docker build -t my-eps .
Now all you need is to create and run the docker container with this command:
this container will be named ‘electrum-personal-server’ will have the network ‘bitcoin_network’ and all config files including config.ini should be in ‘/Volumes/Open/eps’ folder.
docker run -d --network bitcoin_network -v /Volumes/Open/eps:/eps -p 50002:50002 --name eps my-eps electrum-personal-server /eps/config.ini