Raspberry Pi running Alby hub

The big lightning network wallet that runs on hardware that fits your hand

Alby Hub on a Raspberry Pi is surprisingly powerful! 😊 We've seen it handle 100 payments in just 30 seconds without any issues. Truly impressive! ⚡

In this guide, you are going to build a super small lightning network node using the cheapest (but strong) hardware that can be purchased by almost anyone. ⚡

Intro and requirements

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

  • A windows or mac or linux computer

  • Raspberry Pi Zero 2W (you can use other Raspberry pi models!)

  • Mobile phone charger wih miniUSB connection (to charge the Raspberry pi Zero 2W)

  • SD memory card (at least 32gb)

  • Adapter SD card to USB (to plug it on your computer and download the OS)

Instalation

1. Install RPI imager on your computer. ðŸ–Ĩïļ Run it and choose "Raspberry Pi Zero 2W" as the device (Or whatever model you use!)

2. In "Operating System" choose: "Other -> RASPBERRY PI OS LITE (32-BIT)" as the image

3. Insert the SD card to your computer. ðŸ’ū Choose the SD card you just inserted as the storage device in the RPI Imager.

4. Click on Next and then choose to "Edit Settings" and apply OS customisation settings

5. In OS Customization, we are going to check and modify settings on "General" and "Services." ⚙ïļ

  • On "General," set the hostname as "albyhub.local" (the .local is already set, just write "albyhub").

  • Set "albyhub" as the username, and choose a strong password.

  • For wireless LAN, enter the name of your Wi-Fi network as SSID and enter its password.

  • On "Services," enable SSH.

6. Write the image (Be aware: everything on that SD card will be erased by the RPI Imager) 🚀

7. Once it is finished, ignore the Windows warnings. Remove the SD card from your computer. ðŸ’ŧ

8. Place the SD card into the Raspberry Pi and plug it into a power connection. 🔌

The Raspberry Pi will turn on automatically as soon as you plug it in. If it is the Raspberry Pi Zero 2W, a mobile phone charger with a microUSB connection will suffice. For a bigger Raspberry Pi model, please connect it to its appropriate power source.

The Raspberry Pi will automatically install the content of the SD card, but we won't see anything. We will need to wait for 5 minutes. Meanwhile, you can open a Terminal (Windows, Mac, or Linux terminal—they all work). Terminals won't sting you 🐝. You won't have to write anything; just copy and paste.

9. a (OPTIONAL) You can verify your Raspberry Pi is ready to work by executing this command in your local terminal. ✅ðŸ–Ĩïļ

ping albyhub.local

If you see a ping result as shown in the image below, you can continue to step 9.b.

9.b Copy and paste the following command into your terminal, then hit "Enter."

You will be asked to type the word "yes"; type it. Then, you will be asked to enter your password. Enter the password you chose in step 5 for the username "albyhub."

ssh albyhub@albyhub.local '/bin/bash -c "$(curl -fsSL https://getalby.com/zero/install.sh)"'

10. Waiting period: The terminal will be working. You have to wait. âģ

Once the terminal has finished and a message appears saying "Installation finished, please visit http://albyhub.local," don't go or click yet. Wait another 5 minutes (it won't work immediately, so just wait a little bit longer).

11. You should now be able to visit http://albyhub.local in your browser. 🌐

Congratulations! 🎉

Your Alby hub is now running on a device that fits in your hand. How awesome is that? 👏


Alby hub initial configurations for self-mounts ⚙ïļðŸ”§

After setting up your password (choose a good one), we need to OAuth with your Alby web account.

This is a self-hosted, self-mounted sovereign micro node, so... "Why do I have to connect with an Alby web account?" For the moment we did not have enough time to separate this build from the Alby Cloud offering. OAuth with our Alby web accounts will be completely optional in the future.

FFinally, our self-hosted, self-mounted Alby hub is ready to be operational. 🚀🎉

If you are not sure what to do now that everything is up and running, please go to the initial setup of your Alby hub and wallet. There, you will open your first channel and also make an NWC connection to a wallet interface.


3D Printed Casing

One of our users, Rapax00, made a special 3D printed casing for the Raspy Zero 2W. The design is Also Open Source, feel free to download it, copy it, modify it and use it for your own Raspy Zero 2W Alby ðŸĨ°

More self-mounted Alby hub photos


Maintenance section


Updating regularly

It is recommended to do regular updates, as Alby developers are improving it every week. 🔄âœĻ

From time to time, go to the terminal on the same computer you used to install the self-hosted Alby hub. Copy and paste the following command into your terminal, then hit "Enter."

ssh albyhub@albyhub.local '/bin/bash -c "$(curl -fsSL https://getalby.com/zero/update.sh)"'

Troubleshooting

"Host Key verification failed"

This is an error that appears if we try to reinstall more than once the Alby hub on the SD card. All from the same computer. We had some ssh keys before, we should erase them to make room for the new ones of this new installation. You have to look for the file "known_host" under c:/users/youruser/.ssh/

This file might have only one line, the albyhub's, or several lines. If you are opening with a notepad, be sure to remove the word wrap option so every line becomes a single long line. Look for the ssh key that start with albyhub and erase that line. After that save, and go back to step 9.b

Troubleshooting: TODO Only once for old versions

If you have an old version of Alby Hub on your RPI, please do these once to update it. This only applies for people who installed Alby Hub on their PI before July.

  1. SSH into your RPI

  2. Update your service file

sudo nano /etc/systemd/system/albyhub.service

Change ExecStart to:

ExecStart=/opt/albyhub/bin/albyhub 

3. Save and exit nano (Ctrl + X) 4. run sudo systemctl daemon-reload 5. Run the normal update script from the guide


Debugging

SSH into your RPI

ssh albyhub@albyhub.local

View Alby Hub logs from your RPI

sudo journalctl -u albyhub -f -n 250

Access full logs of Alby Hub and LDK

tail /opt/albyhub/data/log/nwc.log
tail /opt/albyhub/data/ldk/logs/ldk_node_latest.log

Restart your Alby Hub

sudo systemctl restart albyhub

Last updated

Logo

Your bitcoin & nostr companion / from 🐝 with ðŸ§Ą