Deploy Hyperswitch Routing

Route payments across processors with rules and fallback

Deploy Hyperswitch Routing

/var/lib/postgresql/data

Just deployed

/data

Just deployed

/local/bin/files

Deploy and Host self hosted Hyperswitch Routing (Open-Source Payments Orchestrator) on Railway

This template runs Hyperswitch Router and its Control Center on Railway with Postgres and Redis, so you can pick a processor per payment. It suits merchants with two or more processors who want rules, splits and fallback.

About Hosting Hyperswitch Routing open-source software on Railway (self hosted Hyperswitch routing template)

Your payment data stays in your own Postgres instance on Railway, not in a vendor dashboard. This template runs four services: the router on v1.128.0, the Control Center on v1.38.10, Postgres 18 and Redis 8.2, with migrations handled at startup.

Railway gives you the domains, TLS, generated secrets and the volume, so you connect processors and set fallback order instead of wiring infra. Back up MASTER_ENC_KEY, or stored card data becomes unreadable.

Why Deploy Hyperswitch Routing, the Stripe alternative on Railway (Railway Free Trial)

Stripe keeps routing decisions inside one processor, so you can't send a payment to a cheaper acquirer when its auth rate slips. Hyperswitch is Apache-2.0 and free to self host, and you keep the routing rules. Railway's $5 trial covers a full test-mode run.

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 Hyperswitch Routing 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.

Railway vs Other Hosting Providers and VPS for Hyperswitch Routing self hosting

Self hosting Hyperswitch routing is a four-service problem: router, Control Center, Postgres and Redis.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanRouter, Control Center, Postgres 18 and Redis 8.2 wired on one billDroplets plus managed Postgres and Redis, patched and linked by you
AWSThe same containers, internal networking, a domain and TLSECS or EC2, load balancers, RDS and ElastiCache to assemble
HetznerDeploy the image and keep the volume for router filesCheap VMs, but you own compose, TLS and backups

Either way the router container is identical; what changes is how much wiring you maintain.

Common Use Cases for hosted Hyperswitch Routing

  • Currency and country split: send EUR card traffic to one acquirer and USD to another, scoping each rule to the business profile.
  • Percentage rollout: run an 80/20 volume split so a new acquirer sees real traffic before you commit to the switch.
  • Outage fallback: set Default Fallback Routing so payments keep moving when the first processor declines or goes down.
  • Amount bands: route small tickets to the cheaper processor and high-value payments to the acquirer with the better auth rate.
  • Safe testing: A/B test a new rule set against your current setup, check the logged decision per payment, then flip fully.

Dependencies for Hyperswitch Routing Docker hosted on Railway

Four services: hyperswitch-router (ghcr.io/onepush-dev/hyperswitch-router:v1.128.0, port 8080, /health and /health/ready, volume /local/bin/files), control-center (juspaydotin/hyperswitch-control-center:v1.38.10, port 9000), Postgres 18 and Redis 8.2. The router maps Railway's Postgres settings and runs migrations.

Deployment Dependencies for Managed Hyperswitch Routing Service (Payments Orchestration)

All four must be healthy first. Keys are generated: ROUTER__SECRETS__ADMIN_API_KEY (32 chars), JWT_SECRET (48), and 64-char hex MASTER_ENC_KEY, HASH_KEY, ENCRYPTION_KEY. Back up MASTER_ENC_KEY or stored data becomes unreadable.

Implementation Details for Hyperswitch Routing (Using Hyperswitch official docker image)

The image is the official router build, so configure routing in the Control Center and routing APIs, not Railway variables. Keep the admin key server side and test with sandbox processor keys.

How does Hyperswitch Routing compare against other payment routing and orchestration options

Hyperswitch vs Stripe (Stripe Alternative)

  • Multi-processor by design: Stripe is a single processor platform, so your routing options end at its edge. Hyperswitch routes each payment across processors you already hold contracts with.
  • Where Stripe wins: one contract, one dashboard, nothing to operate, and its own authorization work is strong out of the box.

Hyperswitch vs Adyen (Adyen Alternative)

  • Acquirer independence: Adyen is a single acquirer platform. Hyperswitch lets you keep several acquiring relationships and rank them per payment, currency or card type.
  • Where Adyen wins: enterprise coverage, local payment methods and account support come bundled with the relationship.

Hyperswitch vs Spreedly (Spreedly Alternative)

  • Self hosted: Spreedly is closed SaaS. Hyperswitch is Apache-2.0 and runs inside your Railway project against your own Postgres and Redis.
  • Where Spreedly wins: nothing to operate or patch, and its vault has years of production mileage behind it.

Hyperswitch vs Primer (Primer Alternative)

  • Configuration over vendor flows: Primer sells commercial orchestration with no-code workflows. Hyperswitch exposes routing rules, volume splits and fallback order per business profile.
  • Where Primer wins: managed operations and a workflow builder that non-engineers can drive without editing config.

How to use Hyperswitch Routing (the OSS payments orchestration platform)?

  1. Open the Control Center on its Railway domain and sign up.
  2. Create a merchant and profile, then connect two processors in test mode using their sandbox keys.
  3. Open the routing section (menu names are approximate) and set your default fallback order.
  4. Add a volume-based split or a rule-based configuration, then activate it.
  5. Create an API key, then send a few test payments through the router API, one per currency or card type.
  6. Check the logged decision for each payment to see which connector was used.

Every routing decision is logged, so compare the connector on each test payment before you shift live traffic.

How to self host Hyperswitch Routing on other VPS Services (Hyperswitch self hosting guide)

Clone the Repository

Pull the upstream repo, then work from the root:

git clone https://github.com/juspay/hyperswitch
cd hyperswitch

Install Dependencies

You need Docker with Compose, plus Postgres and Redis. The official helper is scripts/setup.sh; run it before you bring anything up.

Configure Environment Variables

Edit config/docker_compose.toml (or let setup.sh prompt you), then set the admin API key, JWT secret and the three 64-character hex keys (MASTER_ENC_KEY, HASH_KEY, ENCRYPTION_KEY). Point the database and Redis variables at your own instances. Back up MASTER_ENC_KEY or stored data becomes unreadable.

Start the Hyperswitch Routing Application

docker compose up -d

Check the router responds on port 8080 at /health, then load the Control Center, sign up and connect a processor in test mode.

Railway does the variable wiring, migrations and health checks for you, so you get the router and dashboard without touching a shell.

Official Pricing of Hyperswitch Routing (Hyperswitch pricing)

Hyperswitch is Apache-2.0, so the software is free to self host. On Railway that means your normal usage bill for the router, Control Center, Postgres and Redis. Juspay's hosted Hyperswitch cloud has usage-based pricing; processors still charge their own fees either way.

Hyperswitch Routing cloud vs self hosted comparison (Pricing, features, costs, and more)

Both paths run the same Apache-2.0 code and the same strategies: rule-based, volume-based and default fallback routing. The difference is who runs Postgres, Redis and the router, and who pays for idle capacity.

Monthly cost of self hosting Hyperswitch Routing on Railway

Expect roughly $15-30 per month for the router, control center, Postgres 18 and Redis 8.2 at light evaluation traffic, plus the $5 Railway trial to start. Processors still bill their own fees on top, and the hosted Hyperswitch cloud uses usage-based pricing you would need to check with Juspay.

System Requirements for Hosting Hyperswitch Routing on a VPS

A small Linux box with 2 vCPU and 4 GB RAM is enough for test-mode routing and the dashboard, though you also own OS patching, Postgres backups and TLS. Keep MASTER_ENC_KEY safe wherever you run it, because losing it makes stored data unreadable.

Frequently Asked Questions (FAQs)

Do I need more than one processor to use routing?

You can, but routing earns its keep with two. One connector means an empty fallback list, so connect a second in test mode first.

What happens when a processor goes down mid-checkout?

It moves to the next connector in your fallback order unless the payment already authorized. Downtime handling is an optimisation layer, so confirm it is active.

Can I route by country, currency or amount?

Yes. Rules accept payment method, amount, currency, country and card type, so you can send EUR cards to one acquirer and USD to another.

How do I test a routing change before switching fully?

Run a volume split such as 80/20 and compare authorization rates per connector. A/B testing compares two setups if you want a cleaner read than a raw split.

Does routing change my integration code?

No. Routing sits behind the same payments API, so your backend keeps posting with the same API key. It is configured per business profile in the Control Center.

Is a retry the same thing as a routing decision?

No. Routing picks a connector up front; a retry resends a failed attempt, possibly elsewhere. Smart retries are a separate setting from routing.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
50
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51