Run LND independently as a container on Docker.
- We use a custom LND image that has tor preinstalled alongside the base image from lightninglabs/lnd.
- See Dockerfile for details.
bitcoind
running on a separate container- Use mu373/docker-bitcoind
- Container name:
bitcoind
(we access RPC using this hostname) - Docker network:
bitcoin-nw
- traefik proxy running on a separate container
- Use mu373/traefik
- Docker network:
traefik-nw
Prepare configuration for lnd
cp docker-compose-template.yml docker-compose.yml
cp lnd/lnd.sample.conf lnd/lnd.conf
vim lnd/lnd.conf # Edit the configuration to fit your needs
# If you want to customize tor configs
cp torrc.d/custom-config torrc.d/my-custom-config
vim torrc.d/my-custom-config
Start the container
docker compose up -d
Access the shell inside the container
# In host
docker ps # Check container id
docker exec -it container_id bash
# In the container
$ lncli getinfo
$ lncli create
$ lncli unlock
See logs
docker logs --tail 100 container_id
- When the traefik is properly setup, you can access the LND REST API at
https://yourlndnode.example.com
at port 443. - Some practical hints
- Setup Tailscale in the host machine
- Create
A
andAAAA
record atyourserver.example.com
, pointing to the host Tailscale IP - Create
CNAME
record atyourlndnode.example.com
, pointing toyourserver.example.com
- Tweak traefik proxy configs in
docker-compose.yml
- This way, you don't have to configure https and certificates within the LND container yourself. Traefik works as a reverse proxy and does all the complicated stuffs for you.
- Options for
lnd.conf
is listed here. start-lnd.sh
comes from the original repository.- Basic commands for
lncli
: (link)