Installing Lightning Network part 2: Here We Go Again

Ronald Mannak
Aug 10, 2018 · 7 min read

In part 1 I installed a Lightning node on a Digital Ocean droplet. The goal was to explore the Lightning Network, and to see if it’s possible to generate passive income. Money can be made by running a Lightning node 24/7 on a server and forwarding payments from nodes to other nodes. The better connected your node is, the higher the changes payments will be routed through your node. So how did the first month go?

One month in

While other nodes have made up to 5% a week, at least for a short amount of time, I noticed I wasn’t making any money all. None. I had about 85 channels to other nodes, but not a single transaction was routed through my node.

A second issue I ran into was that I wasn’t able to connect to some other nodes. Lastly, I noticed that some channels I created were in stuck in a state, for which I opened an issue on GitHub.

So I created a second node to double check if my node was working correctly. Given that I had no problems creating and funding channels, I didn’t expect any major issues. However, it turned out my node had severe issues. It took me almost to solve (most of) the issues. It was a both exciting and frustrating journey.

The main issue I found after setting up the second node was that my two nodes were not able to connect to each other, even though they ran exactly the same software. I opened a separate GitHub issue for the connection problem.

Long story short: the Lightning ports were not set up correctly, and the Lightning software is not able to detect the issue. To make matters worse, the example setup configuration on the C-Lightning readme contained exactly the same error: The Lightning port wasn’t forwarding incoming data to the Lightning Docker container.

The good news is that I did find a much easier way to install a Lightning node using Docker Compose. I also corrected the Lightning readme and created a pull request. Here’s how to correctly set up Lightning node:

Upgrading from Part 1

If you followed the instructions in part 1 to install your Lightning node, you will need to remove the docker containers and remove the config files.

  1. Remove the existing docker containers
  2. Remove the bitcond and clightning config files
  3. Remove the convenience access scripts

You don’t need to (and don’t want to) erase the droplet, since that would force you to restore a backup, which is a difficult and risky procedure (see part 1 for details).

First, log in on your droplet.

Next, remove the existing con

Next, we’ll delete the bitcoin and lighting config files

And delete the convenience scripts.

You’re now ready to reinstall Bitcoin and Lightning. Skip A Fresh Install chapter and continue to chapter (Re-)installing Bitcoin and Lightning.

A Fresh Install

If you didn’t install a Lightning node using the steps explained in part 1, you’ll need set up your node using the following chapter in part 1:

  • Setup Digital Ocean

Then, log in on your droplet.

Next, we’ll create the working directories for bitcoind and clightning:

(Re-)installing Bitcoin and Lightning

So there is a

  1. Set up the firewall
  2. Create Docker containers using docker-compose
  3. Create convenience access scripts

The Digital Ocean droplet comes with a firewall, called ufw. We’re going to open ports 8333 (bitcoin) and 9735 (lightning) for both incoming and outgoing traffic.

If all is well, ufw will report something similar to the list below (plus any other ports that are open).

Next we’ll create the bitcoind and clightning container. Unlike part 1, we’ll use a much easier to use docker-compose script this time.

The content of docker-compose.yml is shown below. Set alias to the chosen name of your node, set announce-addr to the ip-address of the droplet, and optionally set the rgb value to a color that will be used to show your node in Lightning explorers.

Note: the docker-compose.yml file is based on the example in the C-Lightning readme file. Unfortunately, the original readme file contained an error: the containers did not expose the ports. I’ve created pull request #1816 that contains a fix.

Create and run the containers by using docker-compose:

Docker will create and run two containers. The bitcoind container should immediately beging downloading the blockchain. For a clean install, this will take hours.

Since the script will not exit, open a new terminal window or tab and log into your droplet again.

Add a convenience script to access the bitcoind container:

In Nano (step 3 above), edit the bitcoin-cli script as follows:

Add a convenience script for Lightning

In Nano (step 2 above), edit the lightning-cli script as follows:

And that’s it. Enjoy your fully functioning Lightning node!

Well, actually, not quite. You’ll see that the bitcoin-cli script doesn’t work. Since you won’t use it that often, I’m going to keep the broken script here. If you see what’s wrong, please leave a comment and I’ll update the post.

More and Better Connections

In part 1, I listed a few ways to find nodes to connect to. After I posted the article, I came across Moneni, which finds good highly connected nodes your node isn’t connected to.

Errors and Solutions

Although I solved the biggest issue of other nodes not able to connect to my node, there are still major issues I mentioned in part 1 that I haven’t been able to solve yet:


Even after a month, some channels are still stuck in either awaiting lockin or shutting down state. I’ve opened an issue (issue #1776) that hasn’t received any feedback of comments yet. The bitcoins in these channels has been inaccessible for over a month.


I am going to run the server for a few weeks and will share if running a Lightning node is actually profitable at this point.

If you’re running a Lightning node, please considering creating a channel to me and funding the channel. I appreciate it!


Big thanks to Ricky Kazuo Miller, Arsenie Yeremin, David Carter, Chang Li, and the C-Lightning team.

Need a Digital Ocean Account? Follow this referral link to create an account on Digital Ocean and receive $10 (I will receive $25).

If you enjoyed this article, and want to read more or show your appreciation, bitcoin is always appreciated at: 3BADHnwyuK54ZVa1dRtRj6Jj8H2BJz63Rc


Coinmonks is a non-profit Crypto educational publication.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store