Run Alby Hub with Hetzner

Run your own Alby Hub on Hetzner Cloud using an Ubuntu server, Docker Compose, and persistent storage on your server.

Prerequisites

Hetzner is a good option if you want to run Alby Hub on a cost-effective cloud server with full control over the instance, firewall rules, storage, and updates.

Before you begin, make sure you have:

02

Basic familiarity with running terminal commands

Hetzner may require billing details before you can create a cloud server. Depending on Hetzner’s current pricing, your selected server type, region, backups, public IP usage, storage, and traffic, charges may apply. See their pricing page for more details.

Deploy Alby Hub on Hetzner

01

Open your Hetzner project

Go to the Hetzner Cloud Console and open your default project or create a new project for Alby Hub.

02

Create a firewall

Create a firewall

From the sidebar, go to Firewalls and click Create Firewall.

Hetzner firewalls allow you to define which inbound connections can reach your server. All other inbound traffic is dropped. Outbound traffic is allowed by default unless you add outbound rules.

Add the following inbound rules:

Alby Hub web access

Add a rule for Alby Hub:

  • Source: Any IPv4 and Any IPv6, or your own IP address for better security

  • Protocol: TCP

  • Port: 8080

Port 8080 is where Alby Hub runs.

Open the Lightning port for LDK

If you plan to use LDK as your Lightning backend, you must also open port 9735 so your node can accept Lightning peer connections.

Add this rule:

  • Source: Any IPv4 and Any IPv6, or your own IP address for better security

  • Protocol: TCP

  • Port: 9735

Port 9735 is where Alby Hub runs.

You do not need to open port 443 for the basic setup unless you configure HTTPS separately with a reverse proxy or custom domain.

After adding the rules, name the firewall: firewall-albyhub. Then click Create Firewall.

After adding all the above rules, it should look something like this:

03

Create a Hetzner server

From your Hetzner project, click Create Resource and choose Servers.

Use these options:

  • Type: Shared Resources

  • Server type: Choose a small server with at least 2 GB RAM

  • Location: Choose the location closest to you

  • Image: OS Images

  • Operating system: Ubuntu

  • Version: Ubuntu 24.04 LTS

Hetzner may show a newer Ubuntu version by default. Choose Ubuntu 24.04 LTS if it is available.

04

Configure networking and SSH

In the networking section, keep public networking enabled so your server gets a public IP address.

Use these settings:

  • Public IPv4: Enabled

  • Public IPv6: Enabled or leave the default setting

  • Private network: Not required for this basic setup

In the SSH keys section, add your SSH key if you already have one.

If you do not add an SSH key, Hetzner will send the root password to your email after the server is created. Save that password somewhere safe because you will need it to log in through the console or SSH.

05

Attach the firewall and review optional settings

In the Firewalls section, select the firewall you created earlier: firewall-albyhub.

For a basic Alby Hub deployment, you can leave volumes, placement groups, labels, and cloud config unchanged.

Hetzner also offers backups. Backups can help you restore the server later, but they may add extra cost. Review the option and enable it only if you want Hetzner-managed server backups.

In the Name section, enter a server name, for example: albyhub. Review the server summary, then click Create & Buy now.

06

Wait for the server to start

After creating the server, Hetzner will show it in your project. Wait until the server is running.

Copy the public IPv4 address. You will need it later to connect to the server and open Alby Hub in your browser.

07

Connect to your Hetzner server

You can connect in either of these ways.

Option A: Use the Hetzner web console

Open your server page and click the Console icon.

When the console opens, log in with the username: root. Then enter the root password sent to your email by Hetzner. If Hetzner asks you to change the root password after the first login, follow the prompt and save the new password safely.

Option B: Use SSH from your terminal

If you added an SSH key or have the root password, connect from your terminal:

ssh
ssh

Replace YOUR_HETZNER_IP with the public IPv4 address of your Hetzner server.

08

Update the server

In the SSH or web console terminal, update the package list and upgrade installed packages:

sudo apt update
sudo apt upgrade -y
sudo apt update
sudo apt upgrade -y

09

Install Docker and Docker Compose

Install Docker and Docker Compose:

sudo apt install -y
sudo apt install -y

Enable and start Docker:

sudo systemctl enable docker
sudo systemctl start

sudo systemctl enable docker
sudo systemctl start

10

Create a working folder for Alby Hub

Create a folder for your Alby Hub deployment:

mkdir albyhub
cd albyhub
mkdir

mkdir albyhub
cd albyhub
mkdir

The albyhub-data folder stores your Hub data on the server.

11

Add the Docker Compose file

You can either download the official Docker Compose file or create it manually.

Option A: Download the Docker Compose file

Run:

wget
wget

Option B: Create the Docker Compose file manually

Create a new file:

Paste the following content:

services:
  albyhub:
    container_name: albyhub
    image: ghcr.io/getalby/hub:latest
    volumes:
      - ./albyhub-data:/data
    ports:
      - "8080:8080"
    environment:
      - WORK_DIR=/data/albyhub
    stop_grace_period: 300s
    # Optional: restart Alby Hub automatically when the server reboots.
    # restart: unless-stopped
services:
  albyhub:
    container_name: albyhub
    image: ghcr.io/getalby/hub:latest
    volumes:
      - ./albyhub-data:/data
    ports:
      - "8080:8080"
    environment:
      - WORK_DIR=/data/albyhub
    stop_grace_period: 300s
    # Optional: restart Alby Hub automatically when the server reboots.
    # restart: unless-stopped

You can add restart: unless-stopped to restart Alby Hub automatically when the server reboots. You will still need to unlock your Hub manually unless auto-unlock is enabled in Alby Hub settings.

Save the file and exit.

In nano, press Ctrl + O, then Enter, then Ctrl + X.

12

Start Alby Hub

Start Alby Hub in the background:

sudo docker compose up -d
sudo docker compose up -d

Check that the container is running:

sudo docker compose ps
sudo docker compose ps

You can also view the logs:

sudo docker compose logs -f
sudo docker compose logs -f

If the logs are running without repeated errors, Alby Hub has started successfully!

Press Ctrl + C to stop following the logs. This does not stop Alby Hub.

13

Open Alby Hub in your browser

Copy the public IPv4 address of your Hetzner server.

Open the following URL in your browser:

For example:

You should see the Alby Hub welcome screen.

You should see the Alby Hub welcome screen.

14

Set up Alby Hub

Click Get Started and follow the setup flow inside Alby Hub.

During setup, save any important recovery or backup information shown by Alby Hub. Your Hub data is stored on your Hetzner server, but you should still keep your own backup so you can recover or migrate your Hub later.

How to update Alby Hub on Hetzner

Alby Hub will show an update banner inside the app when a new version is available. When you see the update banner, connect to your Hetzner server again and update your deployment.

Go to your Alby Hub folder:

cd
cd

Pull the newest image:

sudo
sudo

Recreate the container with the new image:

sudo docker compose up -d
sudo docker compose up -d

Check that Alby Hub started cleanly:

sudo docker compose ps
sudo docker compose logs -f
sudo docker compose ps
sudo docker compose logs -f

If there is no new Alby Hub version available, docker compose pull may pull the same image again. You only need to update when Alby Hub shows an update banner or when you know a new release is available.