Run a Bitcoin Lightning Node on CentOS 7

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

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.