Run an Electrum server with one command
An easily configurable Docker image for running an Electrum server.
Build docker image:
sudo docker build -t electrumx-img docker-electrumx
Run Docker image:
docker run -d -v /home/root/WagerrElectrumX:/data --net="host" -e COIN=Wagerr -e COST_SOFT_LIMIT=0 -e COST_HARD_LIMIT=0 electrumx-img
//Add for testnet launch.
-e NET="testnet"
For Testnet , append this params to above commandline.
-e NET="testnet"
Setup cron for compact the history database and restart electrumx:
crontab -e
0 0 */3 * * docker container restart container-id
Example: specify ENV variable in docker command line
docker run \
-v /home/username/electrumx:/data \
-e DAEMON_URL=http://user:pass@host:port \
-e COIN=BitcoinSegwit \
-p 50002:50002 \
lukechilds/electrumx
If there's an SSL certificate/key (electrumx.crt
/electrumx.key
) in the /data
volume it'll be used. If not, one will be generated for you.
You can view all ElectrumX environment variables here: https://github.com/kyuupichan/electrumx/blob/master/docs/environment.rst
By default only the SSL port is exposed. You can expose the unencrypted TCP port with -p 50001:50001
, although this is strongly discouraged.
You can expose the WebSocket port with -p 50004:50004
.
To access RPC from your host machine, you'll also need to expose port 8000. You probably only want this available to localhost: -p 127.0.0.1:8000:8000
.
If you're only accessing RPC from within the container, there's no need to expose the RPC port.
You can also run a specific version of ElectrumX if you want.
docker run \
-v /home/username/electrumx:/data \
-e DAEMON_URL=http://user:pass@host:port \
-e COIN=BitcoinSegwit \
-p 50002:50002 \
lukechilds/electrumx:v1.8.7
MIT © Luke Childs