← All Posts

Self-Host Alby Hub with Docker: Complete Setup Guide

2026-02-09 — lightning, guide, alby, docker, self-hosting

Why Self-Host Alby Hub?

Alby Hub turns any server into a Lightning node. It runs an embedded LDK node, exposes your wallet to any app that supports NWC (Nostr Wallet Connect), and gives you a web dashboard to manage channels, transactions, and connected apps.

Self-hosting means you control the keys. No custodial risk, no monthly fees, no asking permission to connect your wallet to a new app. All you need is a cheap VPS or spare machine with Docker.

What You'll Need

No Lightning experience required. Alby Hub handles the node internally — you don't need to install LND, CLN, or any other node software.

Step 1: Install Docker

If Docker isn't on your server yet:

# Ubuntu/Debian
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
# Log out and back in for group changes to take effect

Verify it's working:

docker --version
docker compose version

Step 2: Create the Data Directory

Alby Hub stores your node state, channel data, and database on disk. This directory must persist across container restarts.

mkdir -p ~/.local/share/albyhub

Back this directory up regularly. It contains your private keys and channel state. Losing it means losing your channels and on-chain funds.

Step 3: Run Alby Hub

Option A: Docker Compose (recommended)

Create a docker-compose.yml file:

services:
  albyhub:
    image: ghcr.io/getalby/hub:latest
    volumes:
      - ~/.local/share/albyhub:/data
    environment:
      - WORK_DIR=/data
    ports:
      - "8080:8080"
    restart: unless-stopped

Start it:

docker compose up -d

Option B: Docker Run (one command)

docker run -d \
  --name albyhub \
  --restart unless-stopped \
  -v ~/.local/share/albyhub:/data \
  -e WORK_DIR=/data \
  -p 8080:8080 \
  ghcr.io/getalby/hub:latest

Either way, Alby Hub is now running on port 8080. Open http://your-server-ip:8080 to see the setup wizard.

Step 4: Set Up HTTPS with Caddy

Running a Lightning node over plain HTTP is a bad idea — your unlock password and wallet data would be sent in cleartext. Use a reverse proxy with automatic HTTPS.

Caddy is the easiest option. It handles SSL certificates automatically via Let's Encrypt.

Install Caddy

# Ubuntu/Debian
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

Configure Caddy

Edit /etc/caddy/Caddyfile:

hub.yourdomain.com {
    reverse_proxy localhost:8080
}

Replace hub.yourdomain.com with your actual domain. Make sure DNS points to your server's IP.

sudo systemctl reload caddy

Caddy will automatically obtain and renew an SSL certificate. Your Alby Hub is now live at https://hub.yourdomain.com.

Important: The Alby Hub UI should never be exposed directly to the public web. Always access it through a reverse proxy. Add HTTP Basic Auth in Caddy for an extra layer of protection:

hub.yourdomain.com {
    basicauth {
        admin $2a$14$YOUR_BCRYPT_HASH_HERE
    }
    reverse_proxy localhost:8080
}

Generate a password hash with: caddy hash-password

Update your docker-compose.yml to bind only to localhost (so the port isn't exposed directly):

    ports:
      - "127.0.0.1:8080:8080"

Step 5: Complete the Setup Wizard

Open your Alby Hub URL in a browser. The wizard walks you through:

  1. Choose your node — select LDK (the built-in node, recommended for most users)
  2. Set a password — this encrypts your node data. Don't lose it.
  3. Create or import a wallet — generate a new seed phrase or import an existing one
  4. Link your Alby Account (optional) — enables Lightning address, encrypted backups, and the Alby app marketplace

Once complete, you'll see the Alby Hub dashboard with your node running.

Step 6: Fund Your Node and Open a Channel

A Lightning node needs at least one channel to send and receive payments.

Recommended: Use the default wizard. When you first set up Alby Hub, the setup wizard offers to open your first channel through an LSP (Lightning Service Provider). This is the easiest path — you get a channel with incoming liquidity built in, so you can receive payments immediately without waiting for someone to open a channel back to you.

If you skipped the wizard or want to open additional channels manually:

  1. Go to the Node tab in the dashboard
  2. Click Receive to get a Bitcoin on-chain address
  3. Send some sats to that address (50,000–500,000 sats is a good starting range)
  4. Wait for 1 confirmation (~10 minutes)
  5. Click Open Channel — Alby Hub can suggest well-connected peers, or you can enter a specific node URI

Once the channel confirms on-chain, your node is ready to transact on Lightning.

Step 7: Connect Apps with NWC

The killer feature of Alby Hub is NWC — one wallet, every app. To connect an app:

  1. Go to App Connections in the dashboard
  2. Click Add Connection
  3. Name it (e.g., "Damus" or "Amethyst")
  4. Set a spending limit (optional but recommended)
  5. Copy the NWC connection string
  6. Paste it into your app's wallet settings

NWC connection strings look like:

nostr+walletconnect://<pubkey>?relay=wss://...&secret=<secret>

Each connected app gets its own isolated connection. You can revoke access at any time without affecting other apps.

Step 8: Set Up Sub-Wallets

Alby Hub supports sub-wallets — isolated balances within your node. These are useful for:

Create one from App ConnectionsAdd Connection → choose Isolated Balance. The sub-wallet has its own NWC string and spending limits, but routes payments through your node's channels.

Maintenance and Backups

Updating

# Docker Compose
docker compose pull
docker compose up -d

# Docker Run
docker pull ghcr.io/getalby/hub:latest
docker stop albyhub && docker rm albyhub
# Re-run the docker run command from Step 3

Backups

Your node state lives in ~/.local/share/albyhub/. Back this up regularly:

# Stop the container first to avoid corrupted state
docker compose stop
tar -czf albyhub-backup-$(date +%Y%m%d).tar.gz ~/.local/share/albyhub/
docker compose start

If you linked your Alby Account, encrypted static channel backups are also stored on Alby's servers as an additional safety net.

Monitoring

Check container health:

docker compose logs -f --tail 50

Set the LOG_LEVEL environment variable to 5 (debug) for more verbose output when troubleshooting.

Common Issues

Container won't start

Check that the data directory has correct permissions:

ls -la ~/.local/share/albyhub/

The directory should be writable by the container user. If not:

chmod -R 755 ~/.local/share/albyhub/

Can't access the web UI

Channel won't open

Make sure your on-chain balance has at least 1 confirmation. The minimum channel size is typically 20,000 sats, but 100,000+ sats channels are more useful for routing.

Payments failing

If outgoing payments fail, you might need more outbound liquidity (larger channels or more channels). If incoming payments fail, you need inbound liquidity — either spend some sats first, or open a channel with a service that provides inbound capacity like lnrouter.app.

What's Next

Your Lightning node is now live, secured with HTTPS, and accessible from any NWC-compatible app. Welcome to self-sovereign Lightning.

Found this useful?

Send a tip via Lightning. One click, no account needed.

Tip 100 sats ⚡