Skip to content

Run LND with bitcoind running in a separate Docker container

License

Notifications You must be signed in to change notification settings

mu373/docker-lnd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-lnd

Run LND independently as a container on Docker.

Prerequisites

  • 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

Setup

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

Accessing the node

  • 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 and AAAA record at yourserver.example.com, pointing to the host Tailscale IP
    • Create CNAME record at yourlndnode.example.com, pointing to yourserver.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.

References

License

MIT

About

Run LND with bitcoind running in a separate Docker container

Topics

Resources

License

Stars

Watchers

Forks