How to automatically rebalance your channels - profitably!

@The_Lorax great guide, thank you for sharing :pray:

I suggest editing the command in step 2. to sudo mkdir -p /mnt/data/upgrades/ as the git clone in step 3. will create the /rebalance-lnd folder

In step 3. instead will be easier if the command is split two:

3a. cd /mnt/data/upgrades/rebalance-lnd
3b. git clone

I still have not got any luck with rebalance-lnd apart an output message saying Could not find any suitable route!

I tried all channels I’d like to rebalance (not many on my side) and all of them give the same output message calling -t [NODEIDHERE]

try LNDg for a rebalancer. its the best and its built in automation

Yeah, that’s what I’m using now… plus the hammock to support my body weight while looking at the routed transactions :slight_smile:

I’ve attempted this solution above, with this error message:

fatal: could not create work tree dir ‘rebalance-lnd’: Permission denied

am I missing steps?

on umbrel or via ssh? Can you share a screenshot?

Way of SSH

try sudo git clone... and insert your password when needed

1 Like

Mind sharing what your AR settings are? I’ve tried setting up AR through LNDg but none of my channels have actually rebalanced yet… Is there a better tutorial you’re aware of outside of the GitHub page? I’m using the sample Global Settings from here but nothing seems to be happening

I tried installing python, it looks like it started and then gave me “[notice] A new release of pip available: 22.3 -> 22.3.1
When I try step 4 it says “no such file or directory”

is there a new version of Python that I need a different command to install??

You shouldn’t be installing python, it’s already installed. The command in step 4 is installing dependencies based on the requirements.txt file (it’s a list of dependencies and the version numbers to install).

Your error suggests that either the rebalance-lnd directory wasn’t created from step 2 or the git clone command from step 3 failed which means the requirements.txt file wasn’t cloned to your system, therefore, it can’t find the file.

Re-run the commands one-by-one and post the full output of the commands. Ignore the pip updates for now.

Ran into the an error when running the command:

./ -c


FileNotFoundError: [Errno 2] No such file or directory: ‘/root/.lnd/tls.cert’

Found the answer in [this thread] which changes the LND directory. So now I’m running the command:

./ --lnddir /home/umbrel/umbrel/app-data/lightning/data/lnd -c

Hey everyone!

I got stuck in step 4

It kept “Running bdist_wheel for grpcio ... |” and stayed there up to 24 hours, then I decided to cancel the process.

Any suggestions or other ways to install the dependencies in “requirements.txt”?


Update: just restarted Umbrel and it worked. :pleading_face:

Thank you for the instructions, I get an error when installing the Python dependencies on Umbrel:

umbrel@umbrel:/mnt/data/upgrades/rebalance-lnd $ pip3 install -r requirements.txt
Looking in indexes:,
Collecting googleapis-common-protos==1.61.0 (from -r requirements.txt (line 1))
  Using cached
Collecting grpcio==1.59.2 (from -r requirements.txt (line 2))
  Using cached
    Complete output from command python egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-012od1g9/grpcio/", line 95, in <module>
        import commands
      File "/tmp/pip-install-012od1g9/grpcio/src/python/grpcio/", line 31, in <module>
        import support
      File "/tmp/pip-install-012od1g9/grpcio/src/python/grpcio/", line 21, in <module>
        from setuptools import errors
    ImportError: cannot import name 'errors' from 'setuptools' (/usr/lib/python3/dist-packages/setuptools/
Command "python egg_info" failed with error code 1 in /tmp/pip-install-012od1g9/grpcio/

Any ideas?
Thanks, Willem

I updated pip, setuptools, and wheel with (see Installing Packages - Python Packaging User Guide):
python3 -m pip install --upgrade pip setuptools wheel
And that helped (it gives some warnings that I ignored for now).