By default charge-lnd connects to `localhost:10009`, using the macaroon file in `~/.lnd/data/chain/bitcoin/mainnet/charge-lnd.macaroon`. If `charge-lnd.macaroon` is not found, `admin.macaroon` will be tried.
When running the install as `root`, `charge-lnd` will be installed to `/usr/local/bin`. Otherwise `charge-lnd` will be installed to `$HOME/.local/bin`.
On newer systems [PEP-668](https://peps.python.org/pep-0668/) is enforced, you need to install to a virtual environment:
If you don't want to install from source, you can use a pre-baked docker image.
charge-lnd is available from [Docker Hub](https://hub.docker.com/repository/docker/accumulator/charge-lnd), and can be installed by
```
$ docker pull accumulator/charge-lnd
```
When running charge-lnd using docker, you'll need to map the LND dir and the volume/path containing the policy config file(s) into the container and pass the endpoint of the LND instance. For example:
```
docker run --rm -v /path/to/my-charge-lnd-configs-folder:/app -v ~/.lnd:/home/charge/.lnd -e GRPC_LOCATION=YOUR.LND.IP.ADDRESS:10009 accumulator/charge-lnd
```
# Running charge-lnd periodically
charge-lnd runs only once, and exits after processing all channels. To keep your fees updated as conditions change, you'll need to make sure charge-lnd runs periodically.
Typically on unix systems, this is done using a service called `cron`.
There are a number of different Lightning Node solutions. There is no one-size-fits-all cron configuration to show here, so if you can't get it to work, check the following:
1. Which user do I run charge-lnd as? charge-lnd needs to be able to read its macaroon file, and it needs access to the TLS certificate (tls.cert). Make sure charge-lnd can access those files.
2. charge-lnd needs to be able to read its policy config file(s)
3. if LND and/or charge-lnd is running in docker, check that charge-lnd can reach LND over the network.
4. Check if you are running via system cron (runs as user root) or user cron (runs as that specific user). When running from system cron, you might need 'sudo' or 'runas' to run as the correct user.
General note: it is advised to not run charge-lnd too often (more frequently than once per hour), as this spams the lightning gossip and might even increase forwarding fail rate. If you do want to run it more frequently, please set a reasonable min_fee_ppm_delta (>5) to avoid applying minor fee changes.
On Umbrel you can simply install the [**Lightning Shell**](https://github.com/ibz/lightning-shell) app from the app store. This comes with `charge-lnd` installed and configured to connect to Umbrel's LND. It just works.
However, in order to use it from `cron` you would still have to edit Umbrel's `crontab` as described below. See [this discussion](https://github.com/ibz/lightning-shell/issues/6) for more details.