profile picture

Run your LN node on a Raspberry Pi

Take full control of your Lightning payments with Alby Hub

February 17, 2025 - 1715 words - 9 mins Found a typo? Edit me
open-source bitcoin lightning

cover

In this guide, I’ll show you how to set up a fully custodial Lightning Network (LN) node using Alby Hub on a Raspberry Pi, giving you complete control over your node. Alby Hub offers a DIY free version for a self-custodial Lightning wallet, ensuring full ownership of your funds while being 100% open-source.

It supports both Lightning and Nostr addresses, enabling seamless connectivity across ecosystems, and integrates effortlessly with dozens of Bitcoin applications. With built-in Lightning Service Provider (LSP) services and the Alby Go mobile app, managing your node on the go has never been easier.


Important: This is NOT a Bitcoin miner or a full node. It’s simply a Raspberry Pi running on an SD card power-efficient and low-cost.

⚠️ Disclaimer ⚠️

Anyway, I’ve included a brief recap of the Lightning Network basics in Part 0.


Content


Part 0

What is the LN? - up

The LN is a second-layer solution built on top of Bitcoin to enable fast, cheap, and scalable transactions.

Key Concepts

Goal

LN makes Bitcoin usable for everyday transactions, like buying coffee, without waiting 10+ minutes for confirmations.

In short: Lightning Network = Instant + Cheap Bitcoin payments, secured by Bitcoin’s blockchain.


Part 1

Set up your Alby Hub - up

Alby Hub is a free, open-source (ideally private) Lightning Network node.

Requirements

Before we begin, you are going to need the following things:

tutorial

Installation

1. Flash a linux kernel into the SD card

Suggestion: You can use RPI imager on your computer. Use it to flash the recommended raspi OS for you

tutorial

On the Storage you will see your SD card after inserting it into your laptop.

tutorial

Once you click “Next”, you will see different settings. Click to Edit Settings

tutorial

On Settings > General: set your hostname, the username and password for your admin user. Make sure you enable your WIFI, otherwise you will have to plug it to the router with an RJ-45.

For this tutorial, I am using testhub as hostname, you can use albyhub or whatever you prefer.

tutorial

On Settings > Services: make sure the access via SSH is enabled. We are going to need it to install Alby Hub.

tutorial

Click “Save” and click “Yes” to start the installation.

tutorial

You will see a confirmation. Click “Yes”. It will take ~10 mins…

tutorial

Now we got the SD with a fresh linux kernel ready to use!

tutorial

2. Insert the SD into the raspi

Extract the SD from the laptop and insert it in the raspi first.

tutorial

Once the SD is inserted, then plug in the power cable. It will turn on automatically as soon as you plug it in.

tutorial

3. Alby Hub installation

It will take ~5mins since you turned it on to be able to access to it. How can you make sure it’s alive? Open the terminal and ping the hostname you defined while flashing the SD on Settings > General, remember it ended up with .local:

ping testhub.local

It’s normal if you don’t get any answer at the beginning… until you do get this.

tutorial

Now you can install Alby Hub in your raspi using the SSH connection that you enabled earlier:

# Source code: https://github.com/getAlby/hub/tree/master/scripts/pi-aarch64
ssh testhub@testhub.local '/bin/bash -c "$(curl -fsSL https://getalby.com/install/hub/pi-aarch64-install.sh)"'

You will be asked to type the word “yes”; type it.

tutorial

Then, you will be asked to enter your password. Enter the password you chose in Settings > General for the username.

tutorial

4. Alby Hub Setup

Wait another 2-3 mins and visit your host: http://testhub.local/

tutorial

Your Alby hub is now running. Let’s connect it to your GetAlby account!


Part 2

Create your free GetAlby account - up

🔗 getalby.com/users/new

tutorial


Part 3

Connect your GetAlby with Alby Hub - up

I created an account named testhub.

Left: the GetAlby account. Right: the node in the raspi.

tutorial

Click “Connect Now”.

tutorial

Click “Request Authorization Code”.

tutorial

You get the auth code (left) that you need to insert it into your setup (right).

tutorial

Create a Password for your Alby Hub installed in your raspi. It can be different from the password that you set up for your root user in the rapi itself.

tutorial

tutorial

tutorial

Now it’s time to Link your Alby Account

tutorial

Unless you specify otherwise, set the default “Budget renewal: Monthly 1M sats”.

tutorial tutorial


Part 4

Open your LN channels - up

I recommend following the Initial Steps to set up your Alby Hub.

tutorial

Let’s open the first channel.

tutorial

You need to pay ~$20 in sats to open a 1M sats incoming liquidity channel.

tutorial

After the payment, then you will see the channel open. It might take a couple of mins until the funding transaction is mined in the next block.

tutorial


Part 5

Receive sats - up

You can receive sats using your LN Address.

Left: Public page linked to your node. Right: Private page from your Alby Hub.

tutorial

Optional: You can add ln funds to your wallet using GetAlby’s third-party services: getalby.com/topup - mind the KYC…


Part 6

Use your sats - up

After that, you will be able to use it via the Alby Extension or the AlbyGo.

tutorial

Your node is the ultimate source of truth. Connecting these apps to it will allow you to use your sats seamlessly across different platforms.

tutorial

Disclaimer: the testhub LN address was created only for testing and tutorial purposes. My real address is chemaclass ;)


Extra 1: Updating a running instance

Similar to the installation process, there’s a script available to update your node. You can find it in the source repository: GitHub - Alby Hub Update Script

ssh testhub@testhub.local '/bin/bash -c "$(curl -fsSL https://getalby.com/install/hub/pi-aarch64-update.sh)"'

Extra 2: When the Raspberry Pi shuts down

If the power goes out, the Raspberry Pi will turn off. Once power is restored, it will automatically restart, but Alby Hub will prompt you to enter the password you set.