Run a Bitcoin Lightning Node on CentOS 7

Tired of the privacy invasion of the Chrome webbrowser? Worried about the risk of seeing ads everywhere? Give the Brave Browser a try. It supports all the same Chrome extensions, with none of the telemetry. It auto-blocks ads and helps support content creators like me.

Give the Brave browser a try »

Profile image of Mattias Geniar

Mattias Geniar, February 25, 2019

Follow me on Twitter as @mattiasgeniar

Similar to installing a Bitcoin Core full node, you can run a Lightning Node too. The same developer dependencies are needed.

Prepare your build environment to compile the Lightning Node

The next steps will install a compiler and all development libraries needed to compile a Lightning Network node.

$ yum -y install epel-release

Once EPEL is installed (which adds additional repositories), you can install all needed dependencies.

$ yum install -y autoconf automake boost-devel gcc-c++ git libdb4-cxx libdb4-cxx-devel libevent-devel libtool openssl-devel wget libsodium-devel gmp-devel sqlite-devel python34 asciidoc clang python2-devel pythong34-devel python34-pip

Next, compile the Lightning Network node.

Compile a Lightning Network node from source

With all dependencies in place, it’s time to compile a Lightning Network node. I’ll start by creating a custom user that will run the daemon.

$ useradd lightning
$ su - lightning

Now, while running as the new lightning user, clone & compile the project.

$ git clone https://github.com/ElementsProject/lightning.git
$ cd lightning
$ git checkout v0.6.3
$ ./configure
$ make -j $(nproc)

The above downloads and builds version 0.6.3 of the Lightning Network daemon, for a full list of available releases check out their github release page.

Once compiled, you’ll find the lightning daemon in lightning/lightningd.

$ lightningd/lightningd --version
v0.6.3


Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.