Deploy Lago

Open-source usage-based billing: metering, subscriptions, invoices

Deploy Lago

Just deployed

Just deployed

/data

Just deployed

/var/lib/postgresql/data

Just deployed

Just deployed

Just deployed

Just deployed

Bucket

Bucket

Just deployed

Deploy and Host Lago on Railway

Lago is an open-source billing and metering platform. It ingests usage events, prices them with plans (subscriptions, usage-based, hybrid, prepaid credits), and issues invoices with PDFs, webhooks and payment-provider integrations (Stripe, Adyen, GoCardless). It is a self-hosted alternative to Stripe Billing or Chargebee, with a web app and REST and GraphQL APIs.

About Hosting Lago

Lago is several processes around one database: a Rails API, a Sidekiq worker for invoices, PDFs and webhooks, a clock process for scheduled billing, a Gotenberg service for invoice PDFs, and a React web app. It needs PostgreSQL with the pg_partman extension, Redis, and file storage that the API and worker share. This template wires all of it up on Railway's private network. It creates the first organization and admin user on first boot, generates every secret and the webhook-signing key, keeps public sign-up off, and stores files in a Railway Bucket. You only enter the admin's email.

Common Use Cases

  • Usage-based billing for APIs, AI products and SaaS: meter events and invoice per unit, per tier or per package
  • Subscriptions with add-ons, coupons, prepaid credits (wallets) and invoice PDFs, connected to Stripe, Adyen or GoCardless for payment collection
  • Self-hosted billing when you want your billing data and customer records on your own infrastructure

Dependencies for Lago Hosting

  • PostgreSQL 15 with pg_partman (Lago's own image, built from the template repo)
  • Redis, and S3-compatible storage (a Railway Bucket)

Deployment Dependencies

Implementation Details

Services: lago-front (web app, public), lago-api (API, public), lago-worker, lago-clock, lago-pdf (Gotenberg), Postgres (with a volume), Redis and a Bucket.

First login: open the lago-front domain and sign in with the email you entered and the password in lago-api → Variables → LAGO_ORG_USER_PASSWORD. Your API key is under Developers → API keys, and the API base URL is the lago-api domain.

The admin user and organization are created once. To change the password later, change it in the app, not in the variable. To send emails, add LAGO_FROM_EMAIL and the LAGO_SMTP_* variables on lago-api and lago-worker. Each service's Dockerfile pins the upstream image by version and digest, so updates arrive as "update available" notices you apply when you choose.

Why Deploy Lago on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Lago on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

Bucket

Bucket

More templates in this category

View Template
Plausible WordPress
Cookie-free WordPress stats from your own Plausible

onepush
0
View Template
Typesense Multilingual
Locale-aware multilingual search with Typesense

onepush
0
View Template
Formbricks
Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube

Two Workspaces
3