
Deploy FlexPrice [Updated May '26]
FlexPrice [May '26] (Usage-Based Billing, Metering & Invoicing) Self Host
flexprice-consumer
Just deployed
Just deployed
/var/lib/postgresql/data
flexprice-api
Just deployed
clickhouse
Just deployed
/var/lib/clickhouse
flexprice-web
Just deployed
flexprice-worker
Just deployed
kafka-new
Just deployed
/var/lib/kafka/data
temporal
Just deployed

Deploy and Host self hosted FlexPrice (Open-Source Usage-Based Billing Platform) on Railway
FlexPrice is an open-source usage-based pricing and billing platform built in Go for SaaS and AI-native companies. It handles real-time usage metering, subscription management, credit systems, feature gating, and automated invoicing — giving developers full control over complex monetization models without vendor lock-in. FlexPrice is a self-hosted alternative to Stripe Billing, Orb, and Chargebee.
About Hosting FlexPrice open-source software on Railway (self hosted FlexPrice template)
Self hosting FlexPrice means your billing data, usage events, invoices, and revenue metrics stay entirely on infrastructure you control. There is no dependency on third-party billing SaaS providers that may impose usage limits or per-transaction fees. With Railway, all infrastructure complexity is handled automatically — service provisioning, private networking, persistent volumes, and database migrations run on each deploy.
Why Deploy FlexPrice, the Stripe Billing alternative on Railway (Railway Free Trial)
Instead of paying per-transaction fees on platforms like Stripe Billing or Orb, you can run your own instance with full control. On Railway, the FlexPrice self hosting cost stays transparent, you only pay for what you use, and the base software is always free. Plus, Railway gives every new user a $5 free trial when signing up with GitHub, making it easy to test the billing stack before committing.
Railway vs Other Hosting Providers and VPS for FlexPrice self hosting
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | One-click deployment of all 8 services with auto networking | Multiple droplets to provision, configure, and connect manually |
| AWS | Transparent pricing, no IAM/VPC complexity | Powerful managed services but unpredictable multi-service billing |
| Hetzner | Fully managed Kafka, ClickHouse, Temporal orchestration | Excellent performance at low cost but requires sysadmin expertise |
Common Use Cases for hosted FlexPrice
Here are common use cases for the open-source billing platform:
- Usage-based billing with real-time metering for API calls, tokens, compute, storage, or data transfer with sub-second latency credit checks.
- Credit and prepaid balance systems with auto top-up, expiration rules, rollover policies, and consumption tracking for AI platforms.
- SaaS subscription management combining flat-rate fees with metered usage overages, seat-based charges, and add-on pricing.
- Feature gating and entitlements to control premium feature access based on plan, usage limits, or credit balance — without code changes.

Dependencies for FlexPrice Docker hosted on Railway
When hosting FlexPrice on Railway, you need PostgreSQL for billing data, ClickHouse for real-time usage analytics, Apache Kafka for event streaming, and Temporal for workflow orchestration.
Deployment Dependencies for Managed FlexPrice Service (OSS Billing Platform)
A managed FlexPrice service on Railway requires PostgreSQL 17, ClickHouse, Apache Kafka (KRaft mode), Temporal, and three application services (API, Consumer, Worker) from the same Go binary.
Implementation Details for FlexPrice (Using FlexPrice official docker image)
This template runs the official FlexPrice Docker image with Railway's managed infrastructure.
FlexPrice runs three services controlled by FLEXPRICE_DEPLOYMENT_MODE: api on port 8080, consumer for Kafka event processing, and temporal_worker for workflow orchestration.
Key envs include FLEXPRICE_POSTGRES_HOST, FLEXPRICE_KAFKA_BROKERS, FLEXPRICE_CLICKHOUSE_ADDRESS, FLEXPRICE_TEMPORAL_ADDRESS, and FLEXPRICE_AUTH_PROVIDER=flexprice for self-hosted authentication.
How does FlexPrice compare against other Billing platforms
FlexPrice vs Stripe Billing (Stripe Billing Alternative)
- Cost & Fees: Stripe Billing charges 0.5-0.8% per transaction. FlexPrice is self-hosted with zero per-transaction fees and works with any payment provider.
- Data Ownership: With FlexPrice, you own your billing data completely. Stripe locks you into their payment ecosystem.
FlexPrice vs Orb (Orb Alternative)
- Pricing Model: Orb charges based on event volume and revenue. FlexPrice offers comparable real-time metering as a fully open-source alternative with no volume-based pricing.
- Self Hosting: FlexPrice can be self hosted for complete data ownership, while Orb is SaaS-only.
FlexPrice vs Chargebee (Chargebee Alternative)
- Usage-Based Focus: Chargebee charges based on revenue with limited usage-based capabilities. FlexPrice is built for usage-based and hybrid pricing models.
- Scalability: FlexPrice uses ClickHouse-powered real-time event processing to handle millions of events at any scale.
FlexPrice vs Building In-House
- Engineering Cost: Custom billing code consumes 20-30% of developer bandwidth for ongoing maintenance. FlexPrice provides metering, invoicing, and credit management out of the box.
- Time to Market: Teams have shipped usage-based billing in under 4 hours with FlexPrice, versus months of custom development.
How to use FlexPrice (the OSS Usage-Based Billing platform)?
You can start configuring pricing models, sending usage events, and generating invoices immediately after deploying, with full flexibility through the FlexPrice open-source platform and SDKs for Go, Python, and JavaScript.
How to self host FlexPrice on other VPS Services (FlexPrice self hosting guide)
Clone the Repository
Download FlexPrice from GitHub.
Install Dependencies
Ensure your VPS has Docker and Docker Compose installed. FlexPrice requires PostgreSQL, ClickHouse, Kafka, and Temporal.
Configure Environment Variables
Set up database credentials and environment variables such as:
FLEXPRICE_POSTGRES_HOSTFLEXPRICE_POSTGRES_PASSWORDFLEXPRICE_KAFKA_BROKERSFLEXPRICE_CLICKHOUSE_ADDRESSFLEXPRICE_TEMPORAL_ADDRESSfor your infrastructure services.
Start the FlexPrice Application
Run docker-compose up -d to start all services and expose port 8080 through your VPS firewall or reverse proxy.
Official Pricing of FlexPrice (FlexPrice pricing)
FlexPrice is open source and free to self-host under the Elastic License 2.0. There are no per-transaction fees, per-event charges, or revenue-based pricing. You only pay for the infrastructure running it. FlexPrice also offers a managed cloud version for teams that prefer not to self-host.
FlexPrice cloud vs self hosted comparison (Pricing, features, costs, and more)
FlexPrice cloud offers convenience with managed hosting, while self hosted FlexPrice gives full control, lower cost, and flexibility to customize billing logic. Self hosting on Railway is often cheaper and more scalable.
Monthly cost of self hosting FlexPrice on Railway
The FlexPrice self hosting cost on Railway is typically $20-$50/month depending on usage volume. This covers all infrastructure — PostgreSQL, ClickHouse, Kafka, Temporal, and application services — with no per-transaction or per-event fees on top.
System Requirements for Hosting FlexPrice on a VPS
FlexPrice requires a server with at least 2 vCPUs, 4GB RAM, and sufficient storage for PostgreSQL and ClickHouse data, with Docker installed.
Frequently Asked Questions (FAQs)
What is FlexPrice self hosted?
FlexPrice self hosted means running the open-source version of FlexPrice on your own server (like Railway, VPS, or Docker) instead of using a managed billing SaaS. This gives you full data ownership, no per-transaction fees, and complete control over your billing logic.
How much does FlexPrice self hosting cost on Railway?
The FlexPrice self hosting cost on Railway is typically $20-$50/month depending on usage volume, covering all infrastructure with no per-transaction or per-event fees.
Is FlexPrice free to use?
Yes, FlexPrice is open source and free to self host under the Elastic License 2.0. You only pay for infrastructure (like Railway or VPS).
What pricing models does FlexPrice support?
FlexPrice supports usage-based, seat-based, credit-based, and hybrid pricing models. You can combine flat-rate subscriptions with metered overages, prepaid credits with expiration and rollover, and feature gating based on usage limits.
Where can I download FlexPrice?
You can get FlexPrice from the official FlexPrice GitHub repository or deploy it on Railway with one click using our template.
What are some alternatives to FlexPrice?
Top alternatives include Stripe Billing, Orb, Chargebee, Amberflo, Lago, and building in-house. FlexPrice stands out as the open-source, self-hosted option with zero per-transaction fees.
Template Content
flexprice-consumer
Shinyduo/flexprice-railwayflexprice-api
Shinyduo/flexprice-railwayclickhouse
clickhouse/clickhouse-server:24.9-alpineflexprice-web
Shinyduo/flexprice-frontflexprice-worker
Shinyduo/flexprice-railwaykafka-new
apache/kafka:latesttemporal
temporalio/auto-setup:1.26.2