The repository ships with aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nicosaporiti/buda-lightning-invoice/llms.txt
Use this file to discover all available pages before exploring further.
fly.toml pre-configured for the budaln app in the gru (São Paulo, Brazil) region, making Fly.io the recommended deployment target for Buda Lightning Invoice. With a single fly deploy command, Fly.io builds the Docker image, provisions a VM, applies your secrets, and makes the service available over HTTPS — no manual infrastructure setup required.
Prerequisites
- A Fly.io account (free tier is sufficient for low-traffic Lightning Address use)
- The
flyctlCLI installed on your local machine - Your Buda.com API credentials:
BUDA_API_KEYandBUDA_API_SECRET - The repository cloned locally and
fly.tomlpresent in the project root
Deployment steps
Install flyctl and log in
Install the Fly.io CLI with the official install script:Then authenticate with your Fly.io account:This opens a browser window for OAuth login. Once complete,
flyctl is ready to use.Create the app (first-time only)
From the repository root, run:Fly.io detects the existing
fly.toml and Dockerfile automatically. Accept the defaults where prompted — the configuration is already tuned for this project. If asked whether to overwrite fly.toml, choose No to preserve the pre-configured settings.If the app name
budaln is already taken on Fly.io, you will be prompted to choose a new name. Update the app field in fly.toml accordingly and adjust the DOMAIN secret in the next step.Set secrets
Inject your credentials and domain as Fly.io secrets. These are encrypted at rest and injected as environment variables at runtime — they are never baked into the image:
DOMAIN is used to build the Lightning Address callback URL in /.well-known/lnurlp/:username. Set it to the public hostname of your deployed app.Deploy
Build and deploy the application:Fly.io builds the Docker image using the included multi-stage Dockerfile — running
npm ci in the build stage and starting the server with npm run start in the final stage. Progress is streamed to your terminal, ending with a confirmation that the release is deployed.fly.toml configuration
Thefly.toml at the repository root was generated for the budaln app on 2025-08-30 and contains the following key settings:
| Setting | Value | Explanation |
|---|---|---|
app | budaln | The Fly.io app name and subdomain (budaln.fly.dev). |
primary_region | gru | Guarulhos (São Paulo), Brazil — closest to the Buda.com exchange servers. |
internal_port | 8080 | The port Fly.io’s proxy forwards traffic to inside the container. Must match the PORT env var. |
force_https | true | All plain HTTP requests are redirected to HTTPS automatically. |
auto_stop_machines | 'stop' | The VM is stopped when there is no inbound traffic, reducing idle costs. |
auto_start_machines | true | The VM is started automatically when a new request arrives. |
min_machines_running | 0 | No machines are kept running at all times — cost-efficient for low traffic. |
memory | 1gb | 1 GB RAM allocated per VM. |
cpu_kind | shared | Shared-CPU VM (the most cost-effective Fly.io tier). |
cpus | 1 | One virtual CPU. |
The server listens on the port defined by the
PORT environment variable. If PORT is not set, it defaults to 8080 — which matches the internal_port = 8080 in fly.toml. Do not change internal_port without also updating the PORT secret.Custom domain
To serve the Lightning Address from your own domain (e.g.pay.example.com) instead of budaln.fly.dev:
-
Add the certificate on Fly.io:
- Follow the DNS instructions printed by the command to point your domain to Fly.io.
-
Update the
DOMAINsecret so the LNURL-pay callback URL reflects the new hostname:This triggers a rolling restart and the new domain will be used for all future Lightning Address metadata responses at/.well-known/lnurlp/:username.