← Back to writing

PAYMENT INFRASTRUCTURE · November 28, 2026

Self-Hosting Payment Infrastructure: Lessons from Building OwnPay

Why a founder chose self-hosted payment infrastructure over hosted gateways: control, routing, data ownership, and the trade-offs nobody mentions.

Every merchant starts by renting payment infrastructure. A hosted gateway is fast to integrate, it handles compliance and fraud tooling, and for a long time that is a reasonable trade. I made the same choice. At some point though, the rent starts to feel less like convenience and more like dependency, and that is the moment worth writing about.

I build payment software, and I am the creator and lead maintainer of OwnPay, an open-source, self-hosted payment platform. This note is the thinking behind that project: why self-hosting payment infrastructure makes sense for some products, when it does not, and what the work actually involves.

What renting a payment gateway really costs

A hosted gateway charges more than fees. It concentrates risk:

None of this means hosted gateways are bad. It means the choice has a price tag that is easy to miss in the first week of integration.

When self-hosting payment infrastructure makes sense

Self-hosting pays off when most of these are true:

  1. Your product, not a client project, owns the payment flow long term.
  2. You need multiple providers or regional coverage, and routing between them matters.
  3. Your finance workflow needs the payment data close to the rest of your system.
  4. You can carry the operational responsibility, or you are building the capability deliberately.

If only the first is true, a hosted gateway is still a sensible answer. Honest scoping saves months.

What a self-hosted gateway actually has to do

The engineering reality is wider than “accept payments”:

Those four requirements shaped OwnPay’s design: gateway plugins for different providers, multi-brand support, ledger bookkeeping, APIs, and signed webhooks. You can read the technical overview on the OwnPay project page.

The trade-offs nobody puts on the landing page

Self-hosting moves responsibility to you. Compliance scope, gateway maintenance, provider API changes, and dispute handling all become your work. The honest summary: you trade an operational bill for an engineering one, and the engineering bill is predictable while the operational one sometimes is not. For a platform business that plans to exist for years, predictable usually wins.

Owning the rails

The decision to build in the open was as important as the decision to build. OwnPay is open source so that other founders can inspect, self-host, and adapt it instead of starting from zero. The project continues to grow through public development, and the mission is simple: payment infrastructure you actually own.

If you are weighing the same decision, start with the flow you need, the providers you trust, and the data you want to keep. Then decide what to rent and what to own. The rest of my projects document the same approach across other systems.

END OF NOTEExplore more writing ↗