Analytics cookies only (Google Analytics, PostHog). No ad networks, no cross-site tracking. See our privacy policy.
An open-source usage-based billing system. Your product sends usage events to its API; you define billable metrics, plans and charges (usage-based, recurring, prepaid, percentage, graduated, package and volume models), and Lago meters the usage, manages customers and subscriptions, generates invoices and credit notes, and handles coupons and prepaid wallets. It is a Rails API with background workers and a clock process, a React web app, PostgreSQL, Redis and a Gotenberg container for PDFs. This is the AGPL-3.0 open-source edition; a premium edition is sold separately.
Runs on a VPS from $12/mo (Kamatera 4GB, 4 GB RAM) · prices checked Nov 2026
Fits home hardware (1,077 MB measured idle, RAM only): Raspberry Pi 4 (4 GB) (arm64 untested), Raspberry Pi 5 (8 GB) (arm64 untested), Repurposed laptop (8 GB), Intel N100 mini PC (16 GB), AMD Ryzen mini PC (32 GB).
Pick Lago when your price depends on how much a customer uses your product: you send events (API calls, tokens, seats, gigabytes), define billable metrics and charge models (standard, graduated, package, volume, prepaid and percentage among them), and Lago meters the usage, rates it against each customer's plan and produces the invoice, deduplicating retried events by `transaction_id`. This is usage-based billing, not a general invoicing tool for freelancers: it has an API-first model (customers, plans, subscriptions, events) and expects a developer to integrate it. It is licensed AGPL-3.0 for the open-source edition, with a premium edition under a commercial licence, and the project says self-hosted and cloud differ in deployment rather than in the API. Our snippet fetches upstream's `docker-compose.yml` at the `v1.57.0` tag (`getlago/api` and `getlago/front` v1.57.0, released 2026-11-05, plus `getlago/postgres-partman:15.0-alpine`, Redis and the Gotenberg PDF image), pins Redis to `7.4.12-alpine` where upstream uses the floating `7-alpine`, drops the published database ports, generates the secrets and the RSA key into `.env`, and sets `LAGO_DISABLE_SEGMENT=true` to opt out of Lago's usage tracking. We did not find an upstream RAM minimum, so our 2048 MB floor is an estimate for the seven long-running containers. In the catalog, Invoice Ninja, InvoiceShelf and SolidInvoice are invoicing applications for sending invoices to clients; Lago is for software companies that meter consumption and bill it automatically, and Kill Bill is the closest alternative, a Java engine for subscription billing with plugins for payment gateways.
Paid link — we earn a commission if you shop through it.
Run these commands on your server:
# Lago — usage-based billing — upstream's docker-compose.yml fetched at the v1.57.0 tag (api, front, worker, clock, PostgreSQL, Redis, PDF service), with Redis pinned and the database ports unpublished
curl -fsSL https://raw.githubusercontent.com/getlago/lago/v1.57.0/docker-compose.yml -o docker-compose.yml
echo "POSTGRES_PASSWORD=$(openssl rand -hex 16)" > .env
echo "SECRET_KEY_BASE=$(openssl rand -hex 64)" >> .env
echo "LAGO_RSA_PRIVATE_KEY=\"$(openssl genrsa 2048 | base64 | tr -d '\n')\"" >> .env
echo "LAGO_ENCRYPTION_PRIMARY_KEY=$(openssl rand -hex 16)" >> .env
echo "LAGO_ENCRYPTION_DETERMINISTIC_KEY=$(openssl rand -hex 16)" >> .env
echo "LAGO_ENCRYPTION_KEY_DERIVATION_SALT=$(openssl rand -hex 16)" >> .env
echo "LAGO_DISABLE_SEGMENT=true" >> .env
cat > docker-compose.override.yml <<'EOF'
services:
db:
ports: !reset []
redis:
image: redis:7.4.12-alpine
ports: !reset []
EOF
docker compose up -d
timeout 600 bash -c 'until curl -fsS -o /dev/null http://localhost:3000/health && curl -fsS -o /dev/null http://localhost/; do sleep 3; done'
# for access from another machine, add LAGO_API_URL=http://SERVER_IP:3000 and LAGO_FRONT_URL=http://SERVER_IP to .env, then run docker compose up -d again
# → http://SERVER_IP — the Lago sign-up form; sign-up stays open to anyone who can reach it until you set LAGO_DISABLE_SIGNUP=true, so create your account straight awayLago's Docker documentation and compose file flag these before you rely on it:
Lago used 1077 MB of RAM at idle on GCP e2-standard-2 · Ubuntu 26.04 LTS · Docker 29.9.3 (first boot, measured Nov 2026). We list a minimum of 2048 MB.
The Lago install snippet is marked verified on Ubuntu 26.04 (Nov 2026).