Running your own Bitcoin full node and Lightning Network node is one of the most empowering ways to take control of your financial sovereignty. While many assume this requires expensive hardware, the truth is you can achieve it affordably using a Raspberry Pi—a compact, low-power computer that costs under $150. This guide walks you through setting up both nodes step by step, even if you're new to command-line tools or Linux.
Whether you're interested in privacy, decentralization, or exploring Bitcoin’s second layer, this tutorial gives you everything needed to run a fully functional node setup with minimal technical overhead.
👉 Discover how to securely manage Bitcoin with powerful tools on OKX.
Hardware Requirements and System Setup
The Raspberry Pi 4B (8GB RAM) is an excellent choice for hosting a Bitcoin and Lightning node. It offers enough processing power, supports 64-bit operating systems, and consumes only about 15W of power—making it far more energy-efficient than traditional desktops.
Recommended Hardware Configuration
- Board: Raspberry Pi 4B (8GB version recommended)
- Storage: 64GB microSD card (Class 10) for the OS
- External Drive: 1TB USB hard drive or SSD (for blockchain data)
- Cooling: Passive aluminum heatsink case or active fan
- Power Supply: USB-C with at least 3A output
- Accessories: HDMI cable, keyboard, mouse (optional if using remote access)
💡 While the 8GB model ensures smooth performance, users have successfully run nodes on 4GB and even 2GB variants. For future-proofing and better multitasking, however, 8GB is ideal.
Bitcoin’s blockchain exceeds 500GB and grows daily, so external storage is essential. Use a dedicated USB-powered drive formatted in NTFS or ext4 to ensure compatibility across systems.
Preparing the Operating System
We’ll use Raspberry Pi OS (32-bit)—a stable, Debian-based system optimized for the Pi. You don’t need deep Linux knowledge; most steps involve copying commands.
Step 1: Flash the SD Card
- Insert your microSD card into your computer.
- Download Raspberry Pi Imager from raspberrypi.com/software.
Open the app and select:
- Operating System: Raspberry Pi OS (Other) > Raspberry Pi OS Full (32-bit)
- Storage: Your SD card
- Click "Write" and wait for completion.
This installs the OS image directly onto the card.
Step 2: Initial Setup
Insert the SD card into the Pi, connect peripherals (monitor, keyboard, mouse), and power it on.
On first boot:
- Set a password for the default user
pi. - Connect to Wi-Fi or Ethernet.
Update software:
sudo apt update && sudo apt upgrade -y
Keep track of your login credentials—they’re crucial for remote access.
Step 3: Enable Remote Access (Optional but Recommended)
If you only have one monitor or want headless operation:
Option A: SSH Access
Enable SSH via:
- Menu > Preferences > Raspberry Pi Configuration > Interfaces > Enable SSH
Then connect from another machine using:
ssh pi@<raspberry-pi-ip-address>Use ifconfig in the terminal to find your Pi’s local IP address (look for wlan0 or eth0).
Option B: Remote Desktop
Install XRDP for GUI access:
sudo apt install xrdp -yFrom Windows, open “Remote Desktop Connection” and enter your Pi’s IP.
👉 Learn how OKX supports secure Bitcoin wallet integrations.
Mounting the External Hard Drive
Bitcoin’s blockchain must be stored externally—your SD card isn’t large or durable enough.
Format & Mount Steps
- Plug in your external drive.
Find the drive name:
lsblkLook for something like
/dev/sda1.Create a mount point:
sudo mkdir /mnt/bitcoinMount the drive:
sudo mount /dev/sda1 /mnt/bitcoinSet permissions:
sudo chown -R pi:pi /mnt/bitcoinMake it permanent by editing
/etc/fstab:sudo nano /etc/fstabAdd this line:
/dev/sda1 /mnt/bitcoin ntfs defaults 0 0(Replace
ntfswithext4if applicable.)
Now your blockchain data will persist across reboots.
Installing and Configuring Bitcoin Core
Bitcoin Core is the reference implementation of Bitcoin. It downloads and validates every transaction since 2009.
Install Bitcoin Core
Run these commands in the terminal:
wget https://bitcoin.org/bin/bitcoin-core-0.21.1/bitcoin-0.21.1-arm-linux-gnueabihf.tar.gz
tar xzf bitcoin-0.21.1-arm-linux-gnueabihf.tar.gz
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-0.21.1/bin/*Verify installation:
bitcoind --versionConfigure Bitcoin Core
Create a config file:
nano /home/pi/bitcoin.confAdd these lines:
datadir=/mnt/bitcoin/blockchain
server=1
txindex=1
prune=0
rpcuser=myusername
rpcpassword=mypassword123
zmqpubrawblock=tcp://127.0.0.1:27500
zmqpubrawtx=tcp://127.0.0.1:27501Save (Ctrl+O, then Enter), exit (Ctrl+X).
Create .bitcoin folder and copy RPC credentials:
mkdir /home/pi/.bitcoin
nano /home/pi/.bitcoin/bitcoin.confPaste only the rpcuser and rpcpassword lines.
Start Bitcoin Core:
bitcoind -conf=/home/pi/bitcoin.conf -daemonCheck sync status:
bitcoin-cli getblockchaininfoInitial sync may take several days depending on internet speed.
Setting Up LND (Lightning Network Daemon)
LND enables fast, low-cost Bitcoin payments over the Lightning Network.
Install LND
wget https://github.com/lightningnetwork/lnd/releases/download/v0.15.4-beta/lnd-linux-armv7-v0.15.4-beta.tar.gz
tar xzf lnd-linux-armv7-v0.15.4-beta.tar.gz
sudo mv lnd-linux-armv7-v0.15.4-beta/* /usr/local/bin/Verify:
lnd --versionConfigure LND
Create config file:
nano /home/pi/lnd.confAdd:
bitcoin.active=true
bitcoin.mainnet=true
bitcoin.node=bitcoind
bitcoind.rpcuser=myusername
bitcoind.rpcpass=mypassword123
bitcoind.zmqpubrawblock=tcp://127.0.0.1:27500
bitcoind.zmqpubrawtx=tcp://127.0.0.1:27501
rpclisten=0.0.0.0:10009
listen=0.0.0.0:9735
tlsextraip=0.0.0.0Set aliases for easier use:
echo "alias lnd='lnd --configfile=/home/pi/lnd.conf'" >> ~/.bashrc
echo "alias lncli='lncli'" >> ~/.bashrc
source ~/.bashrcStart LND:
lndIn a new terminal, create a wallet:
lncli createFollow prompts to set a password and back up your 24-word recovery seed.
Unlock when restarting:
lncli unlockConnect via Zap Wallet (Mobile)
Zap allows easy mobile access to your Lightning node.
Install lndconnect
First install Go:
wget https://studygolang.com/dl/golang/go1.17.3.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.17.3.linux-armv6l.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrcInstall lndconnect:
git clone https://github.com/LN-Zap/lndconnect.git
cd lndconnect
go build
sudo cp lndconnect /usr/local/bin/Generate QR code:
lndconnect --configfile=/home/pi/lnd.conf -i --port=8080Scan the QR code with Zap Android/iOS app while both devices are on the same network.
You now control your funds directly—no third party required.
Frequently Asked Questions
Q: Can I use a lower-spec Raspberry Pi?
Yes! Users run full nodes on Pi 3B+ and 4B with 2GB RAM, though performance improves with more memory.
Q: How long does blockchain sync take?
Typically 3–7 days over broadband. Use bitcoin-cli getblockchaininfo to monitor progress.
Q: Is it safe to leave my node online?
Yes—nodes don’t store private keys unless wallets are created. Always back up seeds and passwords securely.
Q: Can I access my node remotely from anywhere?
Only if you have a public IP or use secure tunneling services (e.g., Tor or reverse proxies). Most home networks use NAT, limiting direct access.
Q: What happens if I lose my LND wallet?
Use your 24-word seed and password to recover funds on another LND instance.
Q: Does running a node earn me Bitcoin?
Not directly—but you support network health, improve privacy, and enable trustless transactions.
Running a Bitcoin full node + Lightning node on a Raspberry Pi is not only feasible but empowering. With under $200 in hardware and a few hours of setup time, you become part of Bitcoin’s decentralized backbone.
This project blends practicality with philosophy—giving you real control over your money while strengthening the network for everyone.
👉 Explore advanced Bitcoin tools and security features on OKX today.