S
Glossary
Self-Hosted Billing
Self-hosted billing is a deployment model where a company runs its billing software on infrastructure it controls, inside its own VPC, data centre, or private cloud, instead of consuming it as a vendor-hosted service. The buyer owns the servers, the database, the upgrades, and the uptime.
Key Takeaways
Self-hosting answers where the software runs; open source answers whether you can read and change the code, and neither implies the other.
Regulation drives most self-hosting decisions: GDPR limits on moving personal data outside the EEA, India's payment data storage directive, and HIPAA business associate terms all push billing data inside the customer's perimeter.
Enterprise security reviews force it with no regulator involved, since every hosted vendor on a subprocessor list is another line for the buyer's counsel.
A self-hosted usage-based billing stack isn't one binary: a production deployment runs PostgreSQL 17, Kafka, ClickHouse, Redis, and Temporal alongside three application processes.
Self-hosting swaps a vendor SLA for your own on-call, and a stalled event consumer at month end means usage that never reaches an invoice.
Is self-hosted billing the same as open source billing?
No. Deployment and licensing are separate axes, and billing evaluations mix them up constantly. Where the software runs decides who holds the data. What the licence says decides whether you can inspect and change the code. Open source billing covers that second axis.
Every combination of the two axes ships as a real product today:
Open source and self-hosted: you clone the repository and run it on your own infrastructure.
Open source and vendor-hosted: the same project bought as a managed service, so you skip the operations and keep the option to leave.
Proprietary and self-hosted: a closed-source build shipped under a commercial licence for on-premise installation, common in banking.
Proprietary and vendor-hosted: the default shape of most SaaS billing tools, where self-hosting is off the table.
Which buyers require billing inside their own perimeter?
Regulated buyers, and enterprises with a hard subprocessor policy. Usage and invoice records carry customer identifiers, consumption patterns, and contract values, so billing data falls under the same rules as the customer record.
What forces it | Who it hits | What the buyer asks for |
GDPR restrictions on transferring personal data outside the EEA | Anyone billing EU customers | Billing data stays in an EU region or on the customer's own hardware |
India's payment system data storage directive | Fintechs and payment companies operating in India | Payment system data stored on servers inside India |
HIPAA business associate agreements | Health tech and clinical software | Fewer third parties touching protected health information |
Public sector and defence contracts | Govtech and infrastructure vendors | Deployment into an accredited environment the vendor can't touch |
Enterprise security review and subprocessor policy | Any startup selling upmarket | The billing vendor off the subprocessor list altogether |
I've watched that last row stall more deals than every regulator combined. A security questionnaire arrives, the billing vendor lands on the subprocessor list, and legal sits on it.
What does a team take on when it runs billing itself?
An event pipeline, an upgrade path, and a pager. The application is the small part. Flexprice's docker-compose.yml shows the floor for a usage-based stack, since it names every service the system needs.
Service in the deployment file | What it does in billing |
PostgreSQL 17 | Holds plans, customers, subscriptions, and invoices |
Kafka 7.7.1 | Carries raw events from event ingestion to the consumer |
ClickHouse 24.9 | Stores and aggregates events for usage metering |
Redis 7 | Caches balances and entitlement checks off the hot path |
Temporal 1.26.2 | Runs long-lived billing workflows, including invoice generation |
API, consumer, and worker processes | Serve requests, drain the stream, run scheduled jobs |
That's five stateful systems before your billing engine issues an invoice, and each carries its own operating work:
Restore drills for the transactional store, tested rather than assumed, since a lost subscription table is lost revenue.
Retention and partitioning for the event store, which grows faster than anything else here.
Upgrades and schema migrations that run without dropping events mid-cycle.
Capacity for month-end close, when billing load peaks and finance can least tolerate a stall.
On-call for a system that isn't your product, because billing failures are revenue failures.
Flexprice is enterprise-grade, open source usage based billing infrastructure for AI and SaaS companies. It can be deployed in your own VPC, on-prem, or on Flexprice's managed cloud. All three run the same engine, so a team can start on the managed cloud and move behind its own firewall later. The repository ships under AGPL-3.0, and Usage Metering is usually the first piece a self-hosting team wires up. One thing to check before a security review: SOC 2 Type II and on-prem deployment sit in the Mission Critical plan, not in the free self-hosted build.
For most teams the real alternative to running billing isn't buying nothing, it's building it:
"Flexprice saved us thousands of development hours that we would have spent building in-house." - Shaunak Srivastava, Founder, Truffle AI (YC W25)
Deployment steps live in the Flexprice docs.
Related terms
Deployment decisions rarely land alone, and these terms usually come up in the same evaluation.
Open Source Billing covers the licensing half of the question this page splits in two.
Billing Engine is the component that turns rated usage into invoices, wherever it runs.
Usage Metering captures consumption, and it's the workload that sets your storage bill.
Event Ingestion is the entry point whose throughput you now own.
Real-Time Metering decides whether balances update during the period or only at close.
Usage Reconciliation is the check that catches what the pipeline dropped.
FAQ
Is self-hosted billing cheaper than a hosted plan?
Rarely, once you count engineering time. The licence may cost nothing, but infrastructure, upgrades, and on-call land on your payroll instead of a vendor invoice. Most teams self-host for data control, not savings.
Does self-hosting billing give you SOC 2 compliance?
No. Running software inside your own perimeter doesn't grant a certification. SOC 2 Type II is an audited attestation over an organisation's controls, so you'd need your own audit of your own environment. Self-hosting can narrow that scope by removing a subprocessor.
Can you self-host Stripe Billing or Chargebee?
No. Neither ships a self-hosted distribution, so billing data sits in the vendor's cloud by design. If usage and invoice records can't leave your infrastructure, the shortlist narrows to products that publish a deployable build.
Back to glossary
















