Deploy Hyperswitch - Open-Source Stripe Alternative (Payments Router)

Self-host Hyperswitch sandbox payments with a pinned, compatible stack.

Deploy Hyperswitch - Open-Source Stripe Alternative (Payments Router)

Just deployed

hyperswitch-router

XavTo/Hyperswitch

Just deployed

Just deployed

/data

hyperswitch-web

XavTo/hyperswitch-web

Just deployed

/var/lib/postgresql/data

Deploy and Host Hyperswitch - Open-Source Stripe Alternative (Payments Router) on Railway

Hyperswitch is an open-source payments orchestrator built in Rust by Juspay. Connect multiple payment processors through a unified API and manage them from a self-hosted dashboard.

About Hosting Hyperswitch - Open-Source Stripe Alternative (Payments Router)

This template provisions five services: the payments router, Control Center dashboard, Web Checkout SDK, PostgreSQL and Redis. Database connections and public frontend URLs are wired automatically. Authentication and encryption secrets are generated independently for every deployment; you do not need to supply a shared template API key.

The template uses a fixed compatible combination: Router 1.123.1, Control Center 1.38.4 and Web SDK 0.131.0. Router and SDK deployment sources are maintained on dedicated Railway branches. The SDK installs locked dependencies and its matching utility revision, then builds with your own Railway URLs. Public services have HTTP health checks with explicit ports. Router startup waits for PostgreSQL and Redis, serializes migrations and records transactional migrations atomically so a restart can safely resume.

This is a development and sandbox stack using the built-in mock card locker. It is not a complete production card-processing deployment.

Common Use Cases

  • Evaluate an open-source payment orchestrator.
  • Develop a checkout integration using simulated payments.
  • Test routing across payment processors with their sandbox credentials.
  • Self-host a staging API and payment-management dashboard.

Dependencies for Hyperswitch - Open-Source Stripe Alternative (Payments Router) Hosting

  • Router: XavTo/Hyperswitch, branch railway-stable-v1.123.1.
  • Dashboard: juspaydotin/hyperswitch-control-center:v1.38.4.
  • Web SDK: XavTo/hyperswitch-web, branch railway-stable-v0.131.0.
  • PostgreSQL 18 with a persistent Railway volume.
  • Redis 7 on Railway's private network.

Deployment Dependencies

Getting started

  1. Wait for all five services to deploy successfully. The SDK compiles during its initial build; the router applies database migrations before becoming healthy.
  2. Open the hyperswitch-control-center public URL and sign up. Signup creates your organization and its administrator account.
  3. Add a test processor in Connectors. The built-in PhonyPay test processor runs locally without external payment-provider credentials. Its API connector name is phonypay. You can also supply your own processor's sandbox credentials.
  4. Configure a default routing rule for your connector and business profile.
  5. Obtain your profile_id, publishable key and backend API key from the dashboard. Keep the backend key on your server.

Create a payment from your backend or terminal, replacing the domain and keys:

curl --request POST 'https://YOUR-ROUTER-DOMAIN/payments' \
  --header 'Content-Type: application/json' \
  --header 'api-key: YOUR-BACKEND-API-KEY' \
  --data '{
    "amount": 1000,
    "currency": "USD",
    "profile_id": "YOUR-PROFILE-ID",
    "authentication_type": "no_three_ds",
    "allowed_payment_method_types": ["credit", "debit"]
  }'

The response contains a payment_id and client_secret. Pass the client secret and publishable key to your frontend; retain the backend API key on your server. Refresh an expired payment intent when needed.

Load https://YOUR-SDK-DOMAIN/HyperLoader.js in your checkout page and configure the SDK:

const hyper = Hyper('YOUR-PUBLISHABLE-KEY', {
  customBackendUrl: 'https://YOUR-ROUTER-DOMAIN'
});
const elements = hyper.elements({
  clientSecret: 'YOUR-CLIENT-SECRET',
  walletReturnUrl: window.location.href
});
const payment = elements.create('payment', {
  layout: 'tabs',
  walletReturnUrl: window.location.href,
  wallets: { applePay: 'never', googlePay: 'never' }
});
payment.mount('#checkout');

// Call from your checkout button.
const result = await hyper.confirmPayment({
  elements,
  confirmParams: { return_url: window.location.href },
  redirect: 'if_required'
});

Use the test card 4242 4242 4242 4242, a future expiry date and CVC 123 with PhonyPay. Check the resulting payment status in the dashboard. A fresh browser session can help when evaluating several SDK configurations. The checkout may load third-party font or processor assets according to upstream SDK behavior.

Persistence and secrets

PostgreSQL stores accounts, connectors and payments on its Railway volume. Redis also has a volume. Keep the database volume and generated secrets together when restoring a deployment.

Do not change ROUTER__SECRETS__MASTER_ENC_KEY or ROUTER__API_KEYS__HASH_KEY after storing data. Changing the encryption key makes existing encrypted records unreadable; changing the hashing key invalidates existing API keys. These values are generated for each new installation and are not shared between users.

Keep Redis private. It has no password because only services in the Railway private network can reach it; do not enable a public TCP proxy. SMTP and external telemetry collection are disabled in this template. Email-based password recovery requires additional configuration.

Scope and updates

Use simulated cards and sandbox credentials. The mock locker does not provide a production card vault or PCI-compliant infrastructure. Production processing requires additional infrastructure and configuration described by Hyperswitch.

The template's versioned sources avoid automatic component upgrades. Newer router releases introduce additional dependencies, so upgrade the stack as a compatible set. Template updates affect new installations; existing projects keep their own source and variables unless you update them explicitly.

The published configuration has been deployed on Railway with all five services running, successful signup and a successful PhonyPay payment. Migration rollback, repeat execution and concurrent startup were also checked.

Why Deploy Hyperswitch - Open-Source Stripe Alternative (Payments Router) on Railway?

Railway provisions the application services, persistent database, private networking and HTTPS domains in one project. This template provides a reproducible sandbox with generated credentials and automatic migrations, so you can start exploring Hyperswitch without manually wiring each component.


Template Content

More templates in this category

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

codestorm
49
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