Open Source Stripe Alternatives 2026
Open Source Stripe Alternatives 2026
TL;DR
There's no single open-source library that replaces Stripe — but there are tools that address specific parts of the problem. Lago is the strongest open-source billing engine in 2026, handling usage-based and subscription billing while delegating actual payment processing to Stripe or Adyen. Kill Bill is the enterprise-grade choice with a decade of production history — but steep setup complexity. Hyperswitch solves payment routing and orchestration (not billing), letting you switch between Stripe, Braintree, and 50+ processors without rewriting integrations. BTCPay Server is for crypto-native businesses. None of these are "drop-in Stripe replacements" — they're purpose-built tools for specific layers of the payments stack.
Key Takeaways
- Lago (YC S22, $22M funded) is the most actively developed open-source billing engine — handles metered/usage-based, subscriptions, and invoicing but requires a payment processor like Stripe for money movement
- Kill Bill has the deepest feature set (dunning, plugins, multi-tenant) but is Java-based with significant ops overhead — best for teams with dedicated infrastructure engineering
- Hyperswitch is a payment orchestration layer, not a billing engine — it routes transactions between processors but doesn't handle subscriptions or invoicing
- BTCPay Server is the only production-ready option for crypto payments — no custodian, no fees
- Invoice Ninja serves freelancers and small agencies, not SaaS subscription businesses
- Flexprice is an early-stage startup targeting AI/usage-based billing — promising but immature
- Self-hosting has real operational costs — hosting, SSL, backups, PCI compliance considerations, and maintenance versus Stripe's 2.9% + 30¢
The Real Question: What Are You Actually Replacing?
Before evaluating alternatives, be specific about which parts of Stripe you want to replace.
Stripe is not one thing — it's a bundle of services:
- Payment processing — Accepting card payments, ACH, international methods
- Subscription billing — Recurring charges, proration, trial periods, upgrades/downgrades
- Usage-based billing — Metered charges based on API calls, seats, GB, minutes
- Invoicing — Invoice generation, PDF rendering, payment links
- Dunning — Smart retry logic for failed payments, email sequences
- Tax calculation — Stripe Tax automatically calculates sales tax, VAT, GST
- Fraud prevention — Stripe Radar's ML-based fraud detection
- Developer experience — SDK, webhooks, dashboard, Stripe CLI
Open-source alternatives exist for layers 2-6. Layer 1 (actual payment processing) requires a licensed payment processor — this is regulated infrastructure that can't be self-hosted by most companies. The open-source tools below handle billing logic while routing actual payment processing to Stripe, Adyen, Braintree, or another licensed processor.
Lago
GitHub: getlago/lago — 7,000+ stars Stack: Ruby on Rails (API), React (UI), PostgreSQL, ClickHouse (optional analytics) License: AGPL-3.0 (self-hosted) or Commercial (Lago Cloud) Funding: $22M — YC S22, notable VC backing
Lago is purpose-built for usage-based and subscription billing — the billing patterns that Stripe Billing handles poorly or expensively. It was founded by former Qonto engineers and targets SaaS companies whose pricing involves metering (API calls, tokens, compute minutes, GB transferred).
What Lago Does Well
Usage-based billing with real-time aggregation. Lago's core feature is accepting raw usage events and aggregating them into billable amounts at invoice time. You send events as they happen; Lago groups them by billing period and applies your pricing model.
# Send a usage event
curl -X POST https://your-lago.com/api/v1/events \
-H "Authorization: Bearer $LAGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": {
"transaction_id": "tx_001",
"external_customer_id": "cust_abc",
"code": "api_calls",
"timestamp": 1711929600,
"properties": { "region": "us-east" }
}
}'
Flexible pricing models. Lago supports flat rate, per-seat, metered, graduated (tiered), package (volume), and percentage-based pricing. You can mix these per plan — e.g., a flat $49/month base with metered add-ons for overages.
Stripe-compatible payment collection. Lago doesn't process payments — it generates invoices and payment intents, then collects payment via Stripe or Adyen. You keep Stripe for money movement while Lago handles billing logic.
# Lago calculates what's owed; Stripe charges the customer
lago_invoice = LagoAPI.get_invoice(invoice_id)
stripe_payment_intent = Stripe::PaymentIntent.create(
amount: lago_invoice.amount_cents,
currency: lago_invoice.currency,
customer: stripe_customer_id
)
Lago's Limitations
- AGPL license means cloud deployment of a modified Lago requires you to open-source your changes — most startups opt for the commercial license
- ClickHouse dependency for large-scale usage analytics adds infrastructure complexity
- No fraud prevention — you're depending entirely on your payment processor's fraud tools
- No tax calculation — you'll need Stripe Tax, Avalara, or manual implementation
Self-Hosting Lago
# Docker Compose deployment
git clone https://github.com/getlago/lago
cd lago
cp .env.example .env
# Configure DATABASE_URL, LAGO_RSA_PRIVATE_KEY, LAGO_API_KEY
docker compose up -d
Lago Cloud (managed hosting) starts at $400/month — for most early-stage startups, the managed version makes more sense than self-hosting.
Best for: SaaS companies with usage-based or metered pricing who want to own billing logic while keeping Stripe for payment processing.
Kill Bill
GitHub: killbill/killbill — 4,300+ stars Stack: Java (Dropwizard), MySQL/PostgreSQL License: Apache 2.0 Founded: 2012 — decade-old, battle-tested in production
Kill Bill is the most feature-complete open-source billing platform, with a plugin architecture that can handle virtually any billing scenario. It's used in production by media companies, telcos, and SaaS providers with complex billing requirements.
Kill Bill's Strengths
Deep dunning and retry logic. Kill Bill's payment retry system is configurable per payment method, failure reason, and customer segment. Overdue invoices trigger configurable email sequences, subscription suspensions, or account cancellations. This is the functionality that would cost $50K+/year in Chargebee or Recurly.
Multi-tenant architecture. A single Kill Bill deployment can serve multiple separate businesses with complete data isolation — critical for agencies or platforms building billing infrastructure for clients.
Plugin ecosystem. Kill Bill has plugins for Stripe, PayPal, Braintree, Adyen, and dozens of other processors. Switching processors is a config change, not a code rewrite.
Invoice customization. Kill Bill's invoicing engine is highly configurable — custom templates, multiple currencies, tax line items, custom fields.
Kill Bill's Reality Check
# docker-compose.yml — Kill Bill stack
services:
killbill:
image: killbill/killbill:latest
environment:
- DB_ADAPTER=mysql
- DB_HOST=db
- DB_PORT=3306
- DB_USER=killbill
- DB_PASSWORD=${DB_PASSWORD}
kaui:
image: killbill/kaui:latest # Admin UI
db:
image: mysql:8.0
The operational complexity is real. Kill Bill expects you to:
- Manage Java application servers and heap sizing
- Run MySQL/PostgreSQL with proper replication
- Monitor plugin compatibility across Kill Bill versions
- Manage database migrations carefully — the schema is complex
For a team without dedicated infrastructure engineers, Kill Bill's ops burden can outweigh its feature advantages.
Best for: Enterprises with complex billing requirements (multi-tenant, custom dunning, legacy integrations) and dedicated engineering resources. Not recommended for startups.
Hyperswitch
GitHub: juspay/hyperswitch — 14,000+ stars Stack: Rust License: Apache 2.0 Backed by: Juspay (payment infrastructure company)
Hyperswitch solves a different problem than Lago or Kill Bill. It's a payment orchestration layer — a unified API that sits in front of multiple payment processors.
What Hyperswitch Does
// One Hyperswitch API for Stripe, Braintree, Adyen, 50+ others
const paymentIntent = await fetch('https://sandbox.hyperswitch.io/payments', {
method: 'POST',
headers: {
'api-key': process.env.HYPERSWITCH_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: 2999,
currency: 'USD',
payment_method: 'card',
connector: 'stripe', // or 'braintree', 'adyen', etc.
routing: { type: 'priority', data: ['stripe', 'braintree'] }
})
});
The routing capability is Hyperswitch's primary value: if Stripe is down or a transaction fails, Hyperswitch can retry through Braintree automatically. For high-volume merchants, this redundancy is meaningful — even a 0.5% improvement in authorization rate on $10M/year is $50K.
What Hyperswitch Doesn't Do
- No subscription management
- No usage-based billing
- No invoice generation
- No dunning or retry sequences
Best for: High-volume payment businesses that need processor redundancy, cost optimization across processors, or unified reporting. Not a Stripe replacement for billing logic — it's a Stripe wrapper/alternative for payment processing specifically.
BTCPay Server
GitHub: btcpayserver/btcpayserver — 7,700+ stars Stack: C# (.NET), SQLite/PostgreSQL License: MIT Funding: Community-funded, non-profit foundation
BTCPay Server is self-hosted payment infrastructure specifically for Bitcoin and other cryptocurrencies. It has no fees (beyond blockchain transaction fees), no custodian, and no KYC requirements — you control the keys.
# One-click deployment on LunaNode or Voltage
btcpay-setup.sh -i
# Or Docker
git clone https://github.com/btcpayserver/btcpayserver-docker
cd btcpayserver-docker
. ./btcpay-setup.sh -i
BTCPay Server supports Bitcoin (Lightning Network for instant/cheap payments), Monero, Litecoin, and other altcoins. Its WooCommerce, Shopify, and WooCommerce plugins let you accept crypto on existing stores with minimal setup.
Best for: Crypto-native businesses, privacy-focused merchants, or any use case where traditional payment rails are unavailable or undesirable. Not a substitute for Stripe if you need traditional card processing.
Invoice Ninja
GitHub: invoiceninja/invoiceninja — 8,400+ stars Stack: PHP/Laravel, React License: Elastic License 2.0 (self-hosted free, certain commercial use restricted) Founded: 2013
Invoice Ninja is popular for freelancers and small agencies who need invoicing without subscription billing complexity. It handles quotes, invoices, expenses, time-tracking, and basic recurring billing.
What Invoice Ninja does well:
- Client portal for invoice viewing and payment
- Multi-currency invoicing
- Time tracking and project-based billing
- Basic recurring invoices
What it doesn't do:
- Usage-based or metered billing
- Subscription lifecycle management (upgrades, downgrades, proration)
- Advanced dunning
Best for: Freelancers and service businesses, not SaaS subscription companies.
Flexprice
GitHub: flexprice/flexprice — 800+ stars Stack: Go, PostgreSQL License: Apache 2.0 Stage: Early (launched 2025)
Flexprice targets AI-native companies with usage-based pricing — specifically billing per token, API call, or compute minute. It's positioned as a lighter-weight alternative to Lago for teams that need metered billing without the full enterprise feature set.
The Go stack means lower resource consumption than Lago's Ruby/Rails backend — relevant for self-hosted deployments on limited infrastructure.
Verdict: Promising, but too early to recommend for production without thorough evaluation. Watch this space — the usage-based billing problem is real and growing as AI API businesses proliferate.
The Self-Hosting Cost Reality
Open-source billing is not free — it's a different cost structure.
| Cost Category | Stripe Billing | Self-Hosted Lago | Kill Bill |
|---|---|---|---|
| Transaction fees | 0.7%–0.8% of revenue | Same (still using Stripe/processor) | Same |
| Subscription billing fee | $0.0005–0.0008/customer | $0 (after Lago cost) | $0 |
| Infrastructure | $0 | ~$200-500/month (managed), $50-150 (self-hosted) | $300-800/month |
| Engineering maintenance | Low | Medium | High |
| Compliance responsibility | Stripe handles | You handle | You handle |
For low-volume businesses under $50K MRR, Stripe Billing's subscription fees are often cheaper than the engineering cost of self-hosting. At $500K+ MRR, the savings from owning billing logic compound meaningfully.
Rule of thumb: Self-hosting billing infrastructure makes sense when your engineering cost to maintain it is less than what you'd pay Stripe or Chargebee annually. For most startups, that crossover happens around $200K-500K MRR.
When to Use Each
| Scenario | Best Choice |
|---|---|
| Usage-based SaaS (API calls, tokens, seats) | Lago |
| Enterprise with complex billing requirements | Kill Bill |
| Multi-processor payment routing | Hyperswitch |
| Crypto payments, self-custody | BTCPay Server |
| Freelance invoicing | Invoice Ninja |
| AI startup metered billing (early stage) | Lago or Flexprice |
| Most startups under $500K MRR | Stay on Stripe |
Methodology
- GitHub star counts and commit activity from github.com (March 2026)
- Lago funding data from Crunchbase and YC company directory
- Self-hosting cost estimates based on DigitalOcean/AWS pricing for equivalent workloads
- License analysis from project repositories (AGPL, Apache 2.0, MIT, ELv2)
- Feature comparisons from official documentation and GitHub READMEs
Related: Best Open Source Alternatives to SaaS Tools 2026, Self-Hosted vs Cloud: When to Switch 2026, Kill Bill vs Lago vs Chargebee 2026. Browse the full billing and payments alternatives on OSSAlt.