Builder's Guide
  • Welcome to the Builder's Guide to the LND Galaxy!
  • The Lightning Network
    • Overview
    • Payment Channels
      • Lifecycle of a Payment Channel
      • Watchtowers
      • Understanding Sweeping
      • Etymology
    • The Gossip Network
      • Identifying Good Peers on the Lightning Network
    • Pathfinding
      • Finding routes in the Lightning Network
      • Channel Fees
      • Multipath Payments (MPP)
    • Lightning Network Invoices
      • Understanding Lightning Invoices
    • Making Payments
      • The Payment Cycle
      • Timelocks
      • ⭐Hashed Timelock Contract (HTLC)
      • Payment Etymology
      • ⭐What Makes a Good Routing Node
      • Understanding Submarine Swaps
      • Instant Submarine Swaps
    • Liquidity
      • ⭐Understanding Liquidity
      • Managing Liquidity on the Lightning Network
      • Liquidity Management for Lightning Merchants
      • How to Get Inbound Capacity on the Lightning Network
      • Lightning Service Provider
    • L402: Lightning HTTP 402 Protocol
      • Macaroons
      • L402
      • πŸ“‹Protocol Specification
      • Implementations and Links
    • Taproot Assets
      • Taproot Assets Protocol
      • Taproot Assets on Lightning
      • Edge Nodes
      • Taproot Assets Trustless Swap
      • FAQ
      • Glossary
  • Lightning Network Tools
    • LND
      • πŸ› οΈGet Started
      • lnd.conf
      • First Steps With LND
      • Wallet Management
      • Sending Payments
      • Atomic Multi-path Payments (AMP)
      • Receiving Payments
      • Unconfirmed Bitcoin Transactions
      • Channel Fees
      • Inbound Channel Fees
      • Macaroons
      • Configuring Watchtowers
      • Pathfinding
      • Blinded Paths
      • Key Import
      • Secure Your Lightning Network Node
      • Configuration of a Routing Node
      • Quick Tor Setup
      • Configuring Tor
      • Enable β€˜Neutrino mode’ in Bitcoin Core
      • Send Messages With Keysend
      • Partially Signed Bitcoin Transactions
      • Bulk onchain actions with PSBTs
      • Sweeper
      • Debugging LND
      • Fuzzing LND
      • LND API documentation
      • Channel Acceptor
      • RPC Middleware Interceptor
      • HTLC Interceptor
      • NAT Traversal
      • Recovery: Planning for Failure
      • Migrating LND
      • Disaster recovery
      • Contribute to LND
    • Lightning Terminal
      • What is Lightning Terminal?
      • πŸ› οΈGet litd
      • Run litd
      • Integrating litd
      • Demo: Litd Speed Run
      • Connect to Terminal
      • Recommended Channels
      • Rankings
      • Health Checks
      • Liquidity Report
      • Opening Lightning Network Channels
      • Managing Channel Liquidity
      • Autofees
      • AutoOpen
      • LND Accounts
      • Loop and Lightning Terminal
      • Loop Fees
      • Pool and Lightning Terminal
      • Command Line Interface
      • Troubleshooting
      • Lightning Node Connect: Under the hood
      • LNC Node Package
      • LITD API Documentation
      • Privacy and Security
      • Privacy Policy
      • Terms of Use
    • Loop
      • πŸ› οΈGet Started
      • The Loop CLI
      • Autoloop
      • Static Loop In Addresses
      • Instant Loop Outs
      • Peer with Loop
      • Loop API Documentation
    • Pool
      • Overview
      • Quickstart
      • πŸ› οΈInstallation
      • First Steps
      • Accounts
      • Orders and Asks
      • Sidecar Channels
      • Zero-confirmation Channels
      • Channel Leases
      • Batch Execution
      • Account Recovery
      • Pool API Documentation
      • FAQs
    • Taproot Assets
      • Get Started
      • First Steps
      • Taproot Assets Channels
      • Asset Decimal Display
      • Become an Edge Node
      • RFQ
      • Collectibles
      • Universes
      • Asset Loop
      • Debugging Tapd
      • Multisignature
      • Minting Assets With an External Signer
      • Lightning Polar
      • Operational Safety Guidelines
      • Taproot Assets API Documentation
    • Aperture
      • βš’οΈGet Aperture
      • LNC Backend
      • LNC Mailbox
      • Pricing
    • Faraday
      • πŸ› οΈGet Started
      • The Faraday CLI
      • Faraday API Documentation
  • LAPPs
    • Guides
      • Use Polar to Build Your First LAPP
        • Setup: Local Cluster with Polar
        • Setup: Run the Completed App
        • Setup: Run the App Without LND
      • Add Features
        • Feature 1: Connect to LND
        • Feature 2: Display Node Alias and Balance
        • Feature 3: Sign and Verify Posts
        • Feature 4: Modify Upvote Action
      • Make Your own LNC-powered Application
    • Next Steps
  • Community Resources
    • Resource List
    • Lightning Bulb πŸ’‘
    • Glossary
    • FAQ
Powered by GitBook
On this page
  • Prerequisites
  • Part 1: Installation
  • Binaries
  • From source
  • Using docker
  • Installing LND using third-party scripts
  • Part 2: Configuration
  • Configuring Bitcoin
  • Configuring LND
  • Recommended configuration
  • Popular configuration
  • Run LND
  • Part 3: Upgrade LND
  • Using the binaries
  • From source
  • Using docker

Was this helpful?

  1. Lightning Network Tools
  2. LND

Get Started

Learn how to install LND on your machine, configure it and keep it up to date.

PreviousLNDNextlnd.conf

Last updated 1 month ago

Was this helpful?

The Lightning Network Daemon is a full implementation of a Lightning Network node. The Lightning Network and its specification are rapidly evolving, and so is LND. Use this guide to install LND from the binaries, source or docker and keep it up to date with new releases.

Prerequisites

Operating system: LND runs on Windows or Mac OS X, but Unix operating systems are recommended, while Debian/Ubuntu is used for the examples below. A 64-bit architecture is required due to files growing larger than 2GB.

Machine: LND requires at minimum 2GB RAM and a 1 GHz quad core with at least 5GB of storage. LND makes frequent reads and writes, meaning you should not use a SD card, but instead a SSD of good quality.

Bitcoin: LND does not require a Bitcoin backend as you may run your node in Neutrino mode. For performance reasons it is recommended to run either Bitcoin Core or btcd on the same machine or on a machine on the same network. You may prune your Bitcoin node, though doing so aggressively may impact performance. To make use of LND’s taproot functionalities you must run at least bitcoind v0.21 or btcd v0.23.1.

Part 1: Installation

Binaries

If you are a regular user and intend to use LND in production, we recommend using the binaries.

gpg –import key.asc gpg --verify manifest-beta.sig manifest-beta.txt

Lastly, you will compare the hash of the .tar.gz file with the hash listed in the manifest.

sha256sum lnd.tar.gz

Unpack: Unpack the compressed tarball to retrieve the binaries.

tar -xvf lnd.tar.gz

Installation: To install the binaries, simply place the files in your path where your operating system can find it, or add the directory containing the binary to your path.

Type $PATH to see your current path directories.

$PATH mv lnd /usr/local/bin

From source

Install go: Installing LND from source is recommended when using it in development or on testnet. To install LND from source, you will need Go version 1.18 or higher.

sudo tar -C /usr/local -xzf go[version].linux-[platform].tar.gz

To permanently include this new directory in your path, add the following lines to your .bashrc file and run . .bashrc to activate it.

export PATH=$PATH:/usr/local/go/bin export GOPATH=~/go export PATH=$PATH:$GOPATH/bin

Install LND: We can install lnd with the following commands. Starting with lnd 0.15 all important subsystems are built by default and no longer have to be manually specified.

git clone https://github.com/lightningnetwork/lnd cd lnd git checkout <most recent version> make install

LND is now installed from source.

Using docker

For those familiar with Docker, or those interested in easily running a variety of software alongside each other, the Docker installation is a convenient and quick way to get started with lightning.

To install LND via Docker you will need docker, make and bash on your system. You can install lnd with the following commands:

git clone https://github.com/lightningnetwork/lnd cd lnd git checkout <latest-release> make docker-release tag=<latest-release>

Installing LND using third-party scripts

Part 2: Configuration

Configuring Bitcoin

You may prune your Bitcoin backend. As LND will then need to fetch some blocks elsewhere, aggressive pruning can lead to performance loss.

rpcauth=[user]:[password hash]

OR

rpcuser=[any username] rpcpassword=[any unique password of your choosing]

To get the latest block data, you should enable ZMQ. The experimental β€œrpcpolling” option can make ZMQ obsolete, making it possible to set up multiple LND nodes per Bitcoind backend, or multiple Bitcoind backends for one or multiple LND using a load balancer.

If your Bitcoin Core and LND nodes are not running on the same machine, you will need to be aware of the relevant IP addresses.

zmqpubrawblock=tcp://127.0.0.1:28332 zmqpubrawtx=tcp://127.0.0.1:28333

When running a full, unpruned Bitcoin node you may set the following flag for small performance improvements:

txindex=1

Btcd: Your btcd backend needs RPC enabled.

rpcuser=[any username] rpcpass=[any unique password of your choosing]

Configuring LND

You will need to specify in this configuration file which backend you prefer to use and how your node should connect to it.

General configuration:

bitcoin.mainnet=true

Neutrino:

bitcoin.node=neutrino feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json

Bitcoind:

bitcoin.node=bitcoind bitcoind.rpcuser=[any username] bitcoind.rpcpass=[any unique password of your choosing] bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333

If you have chosen to omit ZMQ in your bitcoind configuration file, you will have to set the following in lnd instead:

bitcoind.rpcpolling

Btcd:

bitcoin.node=btcd btcd.rpcuser=[any username] btcd.rpcpass=[any unique password of your choosing] btcd.rpccert=

Recommended configuration

rpcmiddleware.enable=true

Popular configuration

The following settings are popular settings for LND:

db.bolt.auto-compact=true alias=<choose a name for your node>

Run LND

Now that we have LND installed and configured with its Bitcoin backend we may start it for the first time.

We may start lnd by simply using the command lnd. Depending on our installation, we might have to specify the location or add it to our path.

lnd

While LND, the Lightning Network Daemon will run in the background, we will use lncli (LND Command Line Interface) to interact with it. lncli will pass our commands to lnd and return useful information back to us.

lncli

Part 3: Upgrade LND

It is recommended to upgrade to the latest release whenever it becomes available. If you miss a release, it is generally recommended to upgrade directly to the latest version.

Using the binaries

You can then gracefully shut down LND with the command lncli stop. This may take a minute.

Now move the binaries to the directory of your existing LND, overwriting the previous binary.

You can now start LND again, unlock the wallet and verify you are using the correct version with lncli version.

From source

You can gracefully shut down LND with the command lncli stop. This may take a minute.

Then navigate to your local copy of the LND github repository and pull from it before installing the latest version of LND.

git pull git checkout <latest release> make clean && make && make install

You can now start LND again, unlock the wallet and verify you are using the correct version with lncli version.

Using docker

If you are running LND in a docker container, you can upgrade this container as follows. Don’t forget to gracefully shut down LND with the command lncli stop before the upgrade. This may take a minute.

First navigate to the local copy of the lnd github repository. Then execute the following commands:

git pull git checkout <latest release> make docker-release tag=<latest release>

You can now start lnd again, unlock the wallet and verify you are using the correct version with lncli version.

Download: You can find up-to-date releases of binaries for various operating systems and architectures .

Verification: Each release is signed by multiple developers. You may find their keys in the . Import these keys and verify the signatures.

Congratulations, you have successfully installed LND using the binary release. . Additionally, you may use to configure LND to run with systemd.

You can find the latest version of Golang . Make sure to verify the checksum before you install Go.

Included subsystems: , , , , , , , , , , ,

Congratulations, you have successfully installed LND using the binary release. . Additionally, you may use to configure LND to run with systemd.

You are now able to find the images in the directory /lnd for your use. Congratulations, you have successfully installed LND using the docker. .

You can install LND inside a variety of third-party software, such as , , or . This might become your installation of choice if you want to use Lightning payments primarily to receive payments in commerce, or if you want to easily run LND along with a variety of other software that leverage your Bitcoin user experience as an individual user.

Neutrino: If you are running LND with Neutrino as a backend, you may skip this section. You may also be interested in how to configure your Bitcoin node to .

Bitcoind: Most importantly, your Bitcoin Core node needs to have RPC enabled, either through rpcauth or with a username and password. The following entries refer to your bitcoin.conf file. you find instructions on how to create an up to date sample configuration file for Bitcoin Core.

You can find your lnd.conf file in ~/.lnd in Linux, ~/Library/Application Support/Lnd in Mac OS X and $LOCALAPPDATA/Lnd in Windows. You can find a .

To make use of and , the needs to be enabled. This can be done by adding the following to the configuration file:

Additionally, you may have a look at the guides β€œβ€ and β€œ.”

If you are running the LND binary, you may download, verify and unpack LND in the same way as during the installation. You can download the latest releases for .

πŸ› οΈ
here
LND repository here
on its official website
autopilotrpc
signrpc
walletrpc
chainrpc
invoicesrpc
neutrinorpc
routerrpc
watchtowerrpc
monitoring
peersrpc
kvdb_postrgres
kvdb_etcd
BTCPay Server
RaspbiBlitz
myNode
Umbrel
serve blocks to light clients in the broader network
Here
sample lnd.conf here
Autofees
LND Accounts
RPC Middleware interceptor
Optimal configuration for a routing node
Tor setup
various operating systems here
Install from the binaries (recommended)
Install from source
Install using docker
Install via third-party platforms
this sample file
Jump to Configuring LND
this sample file
Jump to Configuring LND
Jump to Configuring LND
Upgrade using the binaries (recommended)
Upgrade from source
Upgrade using docker
Video: RUN LND: Building a Node from Scratch