Lago
Lago is an open-source metering and billing platform, and a self-hosted alternative to Stripe Billing and Chargebee. It ingests usage events, aggregates them into billable metrics, applies subscription and usage-based plans, and produces invoices — while payment execution stays with a processor like Stripe or GoCardless. Prepaid wallets, credits, coupons, add-ons, and taxes are built in, along with an API, SDKs, and webhooks.
Overview
Description
Lago is an open-source billing and metering platform, and a self-hosted alternative to Stripe Billing, Chargebee, and Recurly. It is the layer between product usage and the invoice: events are sent to Lago, aggregated into billable metrics (count, sum, max, unique, weighted sum), and priced through plans that can mix a subscription fee with usage charges, tiers, and packages. Lago handles proration, coupons, add-ons, prepaid wallets and credits, and tax, then issues invoices and fires webhooks; moving the money is delegated to a connected payment provider.
Features
- Event metering: Ingest usage via API, and aggregate with count, sum, max, unique, and weighted-sum metrics.
- Flexible pricing: Subscriptions, pay-as-you-go, tiered/volume/package pricing, and hybrid plans.
- Wallets & credits: Prepaid balances, granted credits, coupons, and one-off add-ons.
- Invoicing: Automatic invoice generation, proration, taxes, and dunning.
- Payments: Connectors for Stripe, GoCardless, and Adyen for collection and reconciliation.
- Developer surface: REST API, backend and frontend SDKs, and webhooks for every billing event.
Technology Stack
- Ruby on Rails API
- React / TypeScript frontend
- PostgreSQL and Redis; optional ClickHouse for high-volume event storage
- Docker Compose and a Helm chart for deployment
Requirements
- Docker and Docker Compose (or Kubernetes)
- PostgreSQL and Redis
- ~2 GB RAM; an RSA key pair and app secret generated at setup
Learning resources
Lago: Free Open Source Metering and Usage Based Payment Platform
A look at Lago as a self-hosted billing layer — defining billable metrics, building subscription and usage-based plans, and generating invoices from ingested usage events.
By · Invalid Date
ArticleSelf-hosting Lago with Docker
The official guide to running Lago via the one-container image or Docker Compose, plus the environment configuration for persistent storage, SMTP, Redis, the database, and TLS.
By Lago · Invalid Date