# self-host-lago-billing

Self-host Lago usage-based billing from the upstream compose, pinned to a release and bound to localhost (AGPL-3.0, flagged)

- **Space:** billing-and-subscriptions-public (https://github.com/Tech-Realm/space-billing-and-subscriptions-public/tree/main/self-host-lago-billing)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** bash, docker, git
- **Routes:** lago-docker, killbill; checks: 2
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use billing-and-subscriptions-public/self-host-lago-billing` or MCP `get_pack billing-and-subscriptions-public/self-host-lago-billing`
- **Files:** CHANGELOG.md, code/install.sh, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

Self-host Lago usage-based billing from the upstream compose, pinned to a release and bound to localhost (AGPL-3.0, flagged)

## Goal
A working Lago where we create a billable metric and a plan, send usage events and see a draft invoice.

## Steps
1. `bash code/install.sh` clones getlago/lago at the pinned tag and starts its docker-compose.
2. UI on 127.0.0.1:80: create a billable metric, a plan with graduated charges, a customer, a subscription.
3. POST /api/v1/events with usage; check the draft invoice; export.

## Edge cases
- Lago generates its own secrets on first run (see upstream README).
- AGPL: changes served to others must be published.

## Don'ts
- Don't track main.
- Don't expose Postgres/Redis.



---

Canonical URL: https://logicpacks.io/packs/billing-and-subscriptions-public/self-host-lago-billing

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
