Raspberry Pi Zero

The big computer that fits in your hand

Alby Hub on a Raspberry Pi Zero 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. โšก

This guide is intentend for Raspberry Pi Zero models ONLY. Other Raspberry pi architectures will not work and there will be problems. At the moment If you want to run on arch64 it is recommended at the moment to use the docker setup.

โš ๏ธ Warning

This guide and the installation of Alby Hub on this device are experimental. This means we may encounter bugs that cannot be easily or quickly resolved.

If you still want to try this guide, please ensure you have a backup of your Alby Hub unlock password. Additionally, one of the first steps upon accessing the hub should be to backup your 12-word keys.

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)

Installation

1. Install RPI imager on your computer. ๐Ÿ–ฅ๏ธ Run it and choose "Raspberry Pi Zero 2W" as the device.

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 Zero and plug it into a power connection. ๐Ÿ”Œ

The Raspberry Pi Zero 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 micro USB connection will suffice.

The Raspberry Pi Zero 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 Zero 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/install/hub/pi-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.

Finally, our self-hosted, self-mounted Alby hub is ready. ๐Ÿš€๐ŸŽ‰

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/install/hub/pi-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


Thank you for stopping by! This section was created with contributions from Roland, Moritz & Jean-Paul

Last updated

Logo

Your bitcoin & nostr companion / from ๐Ÿ with ๐Ÿงก