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

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

Self-host Hyperswitch on Railway. Open-source Stripe alternative in Rust.

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

hyperswitch-control-center

juspaydotin/hyperswitch-control-center

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 a production-grade open-source payments orchestrator built in Rust by Juspay. It unifies 100+ payment processors (Stripe, Adyen, Checkout.com, PayPal, Braintree...) behind one API, with smart routing, automatic retries, cost observability, and a self-hosted control center — a true open alternative to closed orchestration platforms.

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

This template deploys the complete Hyperswitch stack on Railway, fully self-hosted with zero external dependencies. It provisions five services: the Rust payments router (with automatic Postgres migrations), the Control Center admin dashboard, the Web Checkout SDK (compiled from source with your Railway URLs baked in), Postgres, and a private Redis. All services are pre-wired through Railway's internal networking and use generated secrets, making the deploy reproducible and secure by default. After deploy, create your admin account, connect a payment processor, configure routing, and start accepting payments through a unified API or the embedded checkout.

Common Use Cases

  • Self-hosted payment orchestration across 100+ processors with smart routing
  • Open-source Stripe alternative with full code transparency and zero vendor lock-in
  • Staging and sandbox environment for testing payment integrations safely
  • Multi-PSP backend for SaaS, marketplaces, and platforms with brownfield accounts
  • Cost observability and success-rate optimization across payment processors

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

  • Rust runtime (bundled in the official juspaydotin/hyperswitch-router image)
  • PostgreSQL 14+ for persistent storage and analytics
  • Redis 6+ for caching, rate limiting, and session state
  • Node.js + ReScript + webpack for compiling the Web SDK from source

Deployment Dependencies

Implementation Details

After deploy, the first-run setup is straightforward:

  1. Open the Control Center URL and create your admin account. The first signup is automatically promoted to org admin.
  2. Go to Connectors → Connect a new processor and add at least one payment processor. Stripe test keys work out of the box, or use the built-in Dummy Connector for instant validation.
  3. Go to Workflow → Routing and set a default routing rule pointing to your connector. This is required before any payment can be confirmed.
  4. Go to Developers → API Keys and generate an snd_... API key for backend integrations and a pk_snd_... publishable key for the frontend SDK.
  5. Get your profile_id from Settings → Business Profile (or via the API call below).

You can then test the full flow with a simple curl to /payments:

curl -X POST https:///payments \
  -H "Content-Type: application/json" \
  -H "api-key: snd_xxxxxxxxxxxxxxxx" \
  -d '{
    "amount": 1000,
    "currency": "USD",
    "customer_id": "test_001",
    "allowed_payment_method_types": ["credit", "debit"],
    "profile_id": "pro_xxxxxxxxxxxxxxxx",
    "authentication_type": "no_three_ds"
  }'

You should receive a JSON response with payment_id, client_secret, and status: "requires_payment_method". Note the client_secret (it expires in 15 minutes).

Then save the following file as test.html on your computer to test the embedded Web Checkout end-to-end. Replace the four placeholders at the top of the script with your own values, then open the file in your browser in a private window (to avoid stale IndexedDB caches from previous tests):

https://github.com/XavTo/Hyperswitch/blob/main/test.html

Click Create Payment, fill the card form with test card 4242 4242 4242 4242, expiry 12/30, CVC 123, then click Pay. With the Dummy Connector, you should see 🎉 Payment succeeded!. With Stripe in test mode, you may see a "Raw Card Data API not enabled" error — this is a Stripe account-level restriction, not a template issue, and it still proves your full SDK → Router → Stripe chain works.

Important notes:

  • Always test the embedded checkout in a private/incognito browser window. The Web SDK uses IndexedDB for session state, and stale caches from previous test sessions (especially during initial setup) can cause the iframe to render blank with no error message.
  • Both walletReturnUrl parameters in the snippet above are required by the SDK validator even when wallets are disabled. Omitting them causes an INTEGRATION ERROR: walletReturnUrl is a required field exception that silently breaks the iframe mount.
  • The client_secret expires 15 minutes after creation. If your test takes longer, regenerate one with the curl call.

Security and scope: This template is designed for development, staging, and sandbox testing of payment integrations. It runs Hyperswitch with the built-in mock locker, so it is not PCI-DSS compliant and should not be used to process real card data without additional infrastructure (PCI-compliant card vault, dedicated VPC, compliance audit). For production card processing, pair Hyperswitch with juspay/hyperswitch-card-vault deployed on compliant infrastructure. The Redis instance is intentionally configured without a password and accessible only via Railway's private network — do not enable public TCP networking on the Redis service.

Master encryption key: The ROUTER__SECRETS__MASTER_ENC_KEY is generated once at deploy as a 64-character hex string and must never be changed afterwards. Changing it will make all encrypted data in the database unreadable.

Known cosmetic warnings: The Web SDK fetches locale JSON files (/assets/v1/jsons/location/*) which return 404 in the self-hosted setup. The SDK falls back to default English strings. The router also logs Unified Connector Service config is missing at startup with an error level — this is cosmetic, UCS is an optional gRPC microservice for advanced deployments and all standard connectors run directly in the router binary. Both warnings are safe to ignore.

Why Deploy Hyperswitch - Open-Source Stripe Alternative (Payments Router) 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 Hyperswitch - Open-Source Stripe Alternative (Payments Router) 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

More templates in this category

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

Lucas
View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

Shahed Nasser
View Template
peppermint
Docker-compose port for peppermint.sh

HamiltonAI