This guide will take you through setting up a machine running ubuntu/debian as a lightning network node. 1. Install Bitcoind $ sudo add-apt-repository -y ppa:bitcoin/bitcoin$ sudo apt-get update$ sudo apt-get install -y bitcoind 2. Install C-Lightning is blockstream’s lightning network daemon. c-lightning $ sudo apt-get install -y \ autoconf automake build-essential git libtool libgmp-dev \ libsqlite3-dev python python3 net-tools$ cd /opt$ git clone https://github.com/ElementsProject/lightning.git lightningd $ cd lightningd$ make 3. Configure Bitcoind and C-Lightning Create a file at with the following contents. **~/.lightning/config** # network=testnet # uncomment to run on testnet instead of mainnet Create a file at with the following contents. **~/.bitcoin/bitcoin.conf** # testnet=1 # uncomment to run on testnet instead of mainnet printtoconsole=1server=1txindex=1 4. Sync with the blockchain This step will take 1–4 hours depending upon the speed of your internet connection. Run the daemon. bitcoin $ bitcoind -daemon In another terminal window run the lightning daemon. $ lightningd Check everything is running correctly. $ lightning-cli getinfo Check the of your target using to discover how far through the syncing process you are. **blockheight** blockchain an explorer Conclusion You’ll want to be running your node on machine that is permanently switched on and connected to the internet. Restarting the daemons even after they’ve downloaded the blockchain takes a long time as they have to reindex transactions in memory. Furthermore, you’ll want your node constantly available so it can accept and route payments, earning you BTC. Personally I’ve used an old laptop which I leave switched on and connected to my router 24/7. For convenience I’ve set up ssh access to it so I can make payments using it. Check out my guide on to learn how to do this. how to make lightning payments Originally published at andrewgriffithsonline .com.