Skip to main content

Set up LNDG With Docker

Up until now we've interacted with our LND node only from the command line.

I recommend you continue to use lncli on the command line for almost all of your "active" management tasks with LND.

This is for a simple reason: Running commands directly on the command line will allow you to definitively know if LND has returned an error message from your command. And if you DO get an error message, you can easily copy and paste this error message into a search engine to learn more.

The problem with using the graphical tools for "actions" like opening and closing channels, is that the GUIs can be unreliable with respect to always displaying complete errors.

So for "actions", like opening and closing channels, I recommend you only use lncli.

However for "monitoring" -- to keep an eye on things like connection status and channel balances -- you will definitely want a graphical interface.

So I also recommend that in addition to lncli, you use at least one GUI (graphical user interface) as well.

Once we set up a GUI, you'll see why it's so helpful for monitoring the state of your LND node.

GUI options

There are several well-regarded GUI packages that work with LND:

  1. Ride The Lightning
  2. Lightning Terminal
  3. Thunderhub
  4. LNDG

I have tried all of these extensively, so I can give you a specific recommendation.

I exclusively use LNDG as my GUI. LNDG is not the prettiest, in fact, its user-interface design is exceptionally basic.

But I have found it to be the most useful out of all of these options, with the fewest problems and edge-cases.

It also provides tools that the other GUIs do not provide.

Let's make sure all our processes are running.

You should have the following terminal windows open on your Ubuntu desktop:

  1. The TOR container running, showing logs.
  2. The Bitcoind container running, showing logs.
  3. The LND container running, showing logs.
  4. The pworker container running, showing logs.
  5. A window where you where you are about to start LNDG.

Now we're ready to start LNDG!

Start LNDG

Run ./start-lndg.sh

You should see some logs, similar to this:

lndg-render-1 | System check identified no issues (0 silenced).
lndg-render-1 | April 04, 2024 - 11:52:04
lndg-render-1 | Django version 5.0.4, using settings 'lndg.settings'
lndg-render-1 | Starting development server at http://0.0.0.0:8000/
lndg-render-1 | Quit the server with CONTROL-C.

We're almost ready to load LNDG in the browser.

First, we need to grab the password, which was auto-generated after the container started.

Using your code editor, find this file: lndg/data/lndg-admin.txt.

In this file will be a password, which will be a short random string, like: rv86f2bh5uadert54e412A.

Keep file open, because you're about to need this password.

Load LNDG in a web browser

Open a web browser on your Ubuntu desktop. Ubuntu comes with Firefox, which will work fine, or you can install a different browser if you want.

Go to this URL: http://0.0.0.0:8000/

You will see security warnings, which you can ignore because you aren't loading this website from the internet, you're loading it from your own computer.

You should get to a page that looks like this:

LNDG Login Page
LNDG Login Page

For the username, use lndg-admin.

For the password, use the string of text from lndg/data/lndg-admin.txt.

You'll then get to a page that looks like this:

LNDG Interface
LNDG Interface

It's not super-pretty, but LNDG has all the tools you need to monitor your node and make decisions about it.

Check in on our Docker processes

We now have five Ubuntu terminal windows open, each running a different Docker container.

Some of you might be shaking your head and saying "this is too complicated!"

That is certainly a valid perspective.

My experience, from years of development, is that although it might seem messy, keeping all of these separate windows open is useful in the long-run as it segregates the logs for each container.

This "log segregation" can help you spot problems and understand what is going on.

There's another command you can use also, to check in on your running containers.

Open a new terminal window with CNTRL+ALT+T... this should be terminal window #6!

In this window, run the command: docker ps

You will see an output like this

CONTAINER ID   IMAGE                            COMMAND                  CREATED             STATUS                    PORTS     NAMES
8f643a8ef9c5 lightninglabs/lnd:v0.17.4-beta "lnd ls" About an hour ago Up About an hour lnd-lnd-1
cf896116af5e lndg-lndg "sh -c 'python initi…" 15 hours ago Up 15 hours lndg-lndg-1
f900fe09a111 pworker-pworker "sh -c 'python3 watc…" 15 hours ago Up 15 hours pworker-pworker-1
9772167bdfdd tor-socks-proxy-tor "/usr/bin/tor -f /et…" 15 hours ago Up 15 hours (unhealthy) tor-socks-proxy
9e23eb7ce035 docker-bitcoind-bitcoind "docker-entrypoint.s…" 15 hours ago Up 15 hours bitcoind

Here are all your running containers, neatly displayed in a table!