Remix made thanks to Awning
The repo is set up to work with Traefik for generating clearnet certs, however its configuration is not here as it is not assumed you have a public IP
for LND wallet creation, for the time being, you'll want to comment out lines 16&17 (shown below), then docker exec -it btcstack_lnd and create wallet/password. Make sure you
LNbits is currently set to use sqlite
# comment lines 16,17 of lnd.conf, set up password which you'll put into config/lnd/password.txt, then uncomment these lines
# wallet-unlock-password-file=/data/.lnd/password.txt
# wallet-unlock-allow-create=true
Something like Umbrel but lighter and portable. Something like RaspiBolt but easier and automated. Bitcoin/Lightning-Network oriented with no frills.
This is a plain/vanilla Docker setup.
This open-source project is provided 'as-is' without any warranty of any kind, either expressed or implied. The developers are not liable for any damages or losses arising out of the use of this software.
Please read the full disclaimer before using this project.
- git
- docker
- docker-compose (or
docker compose plugin)
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.shFollow the steps below:
Please follow this guide if you don't want to preface the docker and the docker-compose commands with sudo.
In this guide sudo will be always omitted.
All the commands need to be run from the project root directory.
Here is the steps:
- Clone this repository
- Edit and customize the
.envfile - Start the Docker containers
- Create or restore a LND wallet
![TODO]
Lnbits
BTCPay
You can also add your BTCPay Server eventually.
Clone or download this repository and enter the project directory.
$ git clone https://github.com/PatMulligan/btcstack-docker.git
$ cd btcstack-docker[!NOTE] Modify .env vars The
.envfile contains some setup parameters that you can/need to customize. Just make a copy of the sample file and edit it.
$ cp .env.sample .env[!TODO] Add any other parameters related to traefik, mempool, etc
Parameter Description UIDThe uid (user id) of your current user. Use this command to retrieve it: id -u.GIDThe gid (group id) of your current user. Use this command to retrieve it: id -g.NODE_ALIASThe alias your LND node will use BITCOIN_ARCHHere you need to choose your computer CPU architecture. Write aarch64for ARM (Raspberry Pi, etc) orx86_64for Intel or AMD.LND_ARCHWrite arm64for ARM (Raspberry Pi, etc) oramd64for Intel or AMD.RTL_PASSWORDChoose the password for accessing the "Ride The Lightning" web interface. You can change it any time but don't forget to restart the RTL container afterwards with docker-compose restart rtl.RTL_VERSIONRTL version LND_PASSWORDChoose the password to automatically protected and unlock the LND wallet (write moneyprintergobrrrif you are migrating from Umbrel). You will need to use this password again here. Changing this after the first setup will have no effect.BITCOIN_CORE_VERSIONBitcoin Core version LND_VERSIONLND version ELECTRS_VERSIONElectrs version
The docker-compose.yml file contains the docker services that your node will run.
Make a copy of the sample file
$ cp docker-compose-sample.yml docker-compose.ymlRun the following command:
$ docker-compose up -d --buildThis will spin-up the following services/containers in background:
The first time it will take some time to build all the images from scratch (especially compiling the Electrs binary can take up to one hour).
After all the images are built, “bitcoind” should start, begin to sync and validate the Bitcoin blockchain. If you already downloaded the blockchain somewhere else, you can just copy the data to the ./data/bitcoin directory before the docker-compose up -d --build command.
Check the status of the bitcoin daemon that was started with the following command. Exit with Ctrl-C
$ docker logs -f btcstack_bitcoinThose services open the following TCP ports on your host:
| Port | Service | SSL | Description |
|---|---|---|---|
50002 |
Electrs | ✅ | Electrs |
8080 |
LND | ✅ | Rest API for LND |
8081 |
RTL | ✅ | RTL web interface |
8082 |
RTL | ⬜ | RTL web interface |
8083 |
BTCPay Server (optional) | ✅ | BTCPay server web interface |
8084 |
BTCPay Server (optional) | ⬜ | BTCPay server web interface |
Once you first start the containers there are still a couple of steps to complete:
If you are migrating from Umbrel or from an existing LND node just copy your data to the ./data/lnd directory before the docker-compose up -d --build command and skip the rest of this step, otherwise run this command:
$ docker exec -it btcstack_lnd lncli createEnter your password as wallet password (it must be exactly the same you stored in .env as LND_PASSWORD).
To create a a new wallet, select n when asked if you have an existing cipher seed. Just press enter if asked about an additional seed passphrase, unless you know what you’re doing. A new cipher seed consisting of 24 words is created.
These 24 words is all that you need to restore the Bitcoin on-chain wallet. The current state of your channels, however, cannot be recreated from this seed.
🚨 This information must be kept secret at all times.
Write these 24 words down manually on a piece of paper and store it in a safe place.
Run the following command from the project root directory to retrieve the Electrs TOR address to use in your wallet:
$ echo `cat ./data/tor/hidden_service_electrs/hostname`:50001Ride The Lightining is accessible on both http and https with a self signed SSL certificate (so expect a warning message from your browser) using the password choosen on the .env file.
If you are running on this machine you can access the web interface through these URLs:
Replace localhost with the IP of your node if you are running on a different PC.
- Download the Zeus app for your mobile phone.
- Open Zeus and tap on “GET STARTED”
- Tap on “Connect a node” and then tap on the “+” at the top right to add your node
- Enter a Nickname for your node (e.g., LndNinja)
- Click on “SCAN LNDCONNECT CONFIG” and, if prompted, allow Zeus to use the camera
- Scan the QR code generated with the following command. It will be a big QR code, so maximize your terminal window and use CTRL+- to shrink the code further to fit the screen
$ URI=`cat ./data/tor/hidden_service_lnd_rest/hostname` && docker exec btcstack_lnd lndconnect --host $URI --port 8080- Click on “SAVE NODE CONFIG”. Zeus is now connecting to your node, and it might take a while the first time.
| Command | Description |
|---|---|
docker ps |
Lists the containers that are running on your host |
docker logs -f btcstack_bitcoin |
Stream the logs for the bitcoin/lnd/electrs container |
docker exec -it btcstack_lnd bash |
Connect to the lnd container so that you can use the lncli command (eg. lncli getinfo) |
docker-compose restart bitcoin |
Restart the bitcoin/lnd/electrs container |
docker-compose build --no-cache |
Rebuild all the containers from scratch (eg. after changing bitcoin version in .env) |
docker-compose down |
Stop all the containers |
docker-compose up -d |
Start all the containers |
docker-compose up -d --build |
Rebuild and start all the containers |
├── configs
│ ├── bitcoin.conf
│ ├── electrs.toml
│ ├── lnbits.env
│ ├── lnd.conf
│ ├── rtl.json
│ └── torrc
├── data
│ ├── bitcoin
│ ├── btcpay
│ ├── electrs
│ ├── lnbits
│ ├── lnd
│ ├── mempool
│ │ ├── api
│ │ └── mysql
│ ├── nbx
│ ├── postgres
│ ├── rtl
│ ├── scb
│ └── tor
├── docker-compose-sample.yml
├── dockerfiles
│ ├── Dockerfile.bitcoin
│ ├── Dockerfile.electrs
│ ├── Dockerfile.lnbits
│ ├── Dockerfile.lnd
│ ├── Dockerfile.nbx
│ ├── Dockerfile.nginx
│ ├── Dockerfile.rtl
│ ├── Dockerfile.scb
│ ├── Dockerfile.tor
│ └── entrypoints
│ ├── lnd.sh
│ └── scb.sh
├── .env.sample
├── fragments
│ ├── bitcoin.yml
│ ├── btcpay.yml
│ ├── electrs.yml
│ ├── lnbits.yml
│ ├── lnd.yml
│ ├── mempool.yml
│ ├── nginx.yml
│ ├── rtl.yml
│ ├── scb.yml
│ └── tor.yml
├── LICENSE
├── README.md
└── run.sh
| Directory | Description |
|---|---|
configs |
Here you can find all the configuration files. Feel free to edit them as you like, but please be carefull to not mess-up with authentication method: Currently uses cookies authentication between services instead of RPC. |
data |
Here is where the data are persisted. The Bitcoin Blockchain, the Electrs indexes, the LND channels, etc. are all stored here. |
dockerfiles |
Here you can find and inspect all the files used to build the images. Don't trust, verify! |
fragments |
All the services that can be added to the docker-compose.yml during the setup tutorial with the run.sh utility script |
You can easily run your own self-hosted instance of BTCPay Server with just a few slight modification to a couple of files provided with this repository:
| File | Modification |
|---|---|
docker-compose.yml |
|
configs/nginx-reverse-proxy.conf |
Uncomment the upstream btcpay and 8083, 8084 server blocks. |
Run docker-compose down and then docker-compose up -d again.
BTCPay server will run 3 additionals containers (requred files and directories are already present on this repository):
If you wish to update Bitcoin/LND/Electrs version just edit the .env file and run the following commands to stop and rebuild the containers:
$ docker-compose down
$ docker-compose up -dIf you wish to update to the last version just run the following commands:
$ docker-compose down
$ git stash
$ git pull
$ git stash applyResolve any git conflicts and run the following command:
$ docker-compose up -d --buildFor any questions or issues you can open a Github issue.
[!TODO] Add Donation link with split to giovantenne If you would like to contribute and help dev team with this project you can send a donation to the following LN address ⚡
⚡ or on-chain
Enjoy!