
Deploy Hyperswitch
Open-source payments switch: route, retry, vault across processors
Redis
Just deployed
/data
hyperswitch-router
Just deployed
/local/bin/files
control-center
Just deployed
Just deployed
/var/lib/postgresql/data
Deploy and Host self hosted Hyperswitch (Open-Source Payments Switch) on Railway
This template deploys Hyperswitch v1.128.0, its Control Center dashboard, Postgres 18, and Redis 8.2. Migrations and key generation run per deploy. For operators testing self-hosted payment orchestration.
About Hosting Hyperswitch open-source software on Railway (self hosted Hyperswitch template)
This template runs the digest-pinned Hyperswitch v1.128.0 router, the v1.38.10 Control Center dashboard, Postgres 18, and Redis 8.2.
Railway handles public domains, health checks, Postgres and Redis provisioning, and automatic migrations. You stay responsible for processor credentials and PCI DSS scope, so this is a test mode and evaluation stack until your compliance work is done.
Why Deploy Hyperswitch, the Stripe and Spreedly alternative on Railway (Railway Free Trial)
Unlike Stripe's single-acquirer lock-in or Spreedly's per-transaction SaaS pricing, self-hosting Hyperswitch on Railway keeps the router, vault, and retry logic in your stack with no orchestration markup.
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 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 self hosting
Railway collapses router, dashboard, Postgres 18, and Redis 8.2 into one deploy with auto migrations and generated secrets. On raw VPS, you assemble and patch that stack yourself.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | Digest-pinned deploy, $5 trial, auto migrations | Manual Docker, Postgres, Redis, and env wiring |
| AWS | Managed services replace EC2, RDS, ElastiCache | EC2, RDS, ElastiCache, VPC, IAM, security groups |
| Hetzner | Generated secrets and health checks | Cheap VMs with docker compose and TLS to manage |
The gap is mostly setup and patching time; PCI scope is yours either way.
Common Use Cases for hosted Hyperswitch
- Multi-processor routing: Set volume splits or priority rules so card payments fall back from Stripe to Adyen when one processor declines, with smart retries handled by the router.
- Sandbox evaluation: Run the full stack in test mode on Railway, connect processor sandbox keys, and validate orchestration logic before any real card data or PCI DSS commitments.
- Unified vault: Tokenize card details once through Hyperswitch's vault and reuse those tokens across connected processors, cutting your direct card-data exposure.
- Merchant operations: Use the Control Center dashboard on Railway to create merchants, profiles, and API keys, then monitor payment attempts and failures from one place.
- Backend payment calls: Your application server hits the router's public /payments endpoint with an api-key header for one-time payments, subscriptions, refunds, and payouts without per-processor code.
Dependencies for Hyperswitch Docker hosted on Railway
This template is a four-service stack: router, control center, Postgres 18, and Redis 8.2. Railway wires database references and generates every key at deploy time.
Deployment Dependencies for Managed Hyperswitch Service (Open-Source Payments Switch)
The router uses ghcr.io/onepush-dev/hyperswitch-router:v1.128.0 on public port 8080. /health returns "health is good"; /health/ready reports database, Redis, and analytics status. The volume is /local/bin/files. Postgres 18 and Redis 8.2 back both.
Implementation Details for Hyperswitch (Built on the Hyperswitch v1.128.0 router)
ROUTER__SECRETS__ADMIN_API_KEY and other API keys are 32 characters, JWT_SECRET is 48, and MASTER_ENC_KEY, HASH_KEY, and ENCRYPTION_KEY are 64-character hex keys. Back up MASTER_ENC_KEY; losing it makes stored data unreadable. PG and ROUTER__REDIS point at the database services.
How does Hyperswitch compare against other payment orchestration platforms
Hyperswitch vs Stripe (Stripe Alternative)
- License: Apache-2.0, self-hosted on Railway with pinned router v1.128.0 and Control Center v1.38.10; Stripe is closed SaaS.
- Processor choice: Routes to 50+ PSPs through one unified API; Stripe ties you to a single acquirer.
- Cost: Free to self-host, you pay only processor fees; Stripe bundles its fee into each transaction.
- Ops: Smart retries, rule-based routing, and revenue recovery run in your own Postgres 18 and Redis 8.2.
- Stripe wins: easier first integration and managed compliance.
Hyperswitch vs Adyen (Adyen Alternative)
- Independence: Mix multiple acquirers and local methods; Adyen bundles acquiring and gateway.
- Source: Open Rust code, runs as four services on Railway; Adyen is proprietary enterprise SaaS.
- Vault: Card tokens stay in your own Postgres-backed vault, not Adyen's environment.
- Adyen wins: direct acquiring, enterprise risk tools, consolidated settlement.
Hyperswitch vs Spreedly (Spreedly Alternative)
- Cost: Free OSS orchestration and vault; Spreedly is commercial SaaS with per-transaction fees.
- Control: Runs in your own Postgres and Redis, migrations automatic; Spreedly is hosted only.
- Reconciliation: Hyperswitch includes reconciliation tooling in the open-source project; Spreedly keeps reporting inside its hosted platform.
- Spreedly wins: managed PCI scope and a simpler API-only setup.
Hyperswitch vs Primer (Primer Alternative)
- Model: Code-level Rust routing plus merchant dashboard; Primer is no-code workflow SaaS.
- Cost: Self-hosted is free, processor fees only; Primer adds platform fees.
- Retries: Smart retries and volume splits configured in Control Center; Primer workflows are GUI-only.
- Primer wins: non-technical workflow builders and faster third-party connections.
How to use Hyperswitch (the OSS Open-Source Payments Switch)?
- Open the control-center dashboard at its Railway domain and sign up.
- Create a merchant and a business profile inside the dashboard.
- Connect a test processor like Stripe or Adyen using sandbox keys, test mode only.
- Generate an API key for that profile; keep it server side.
- Call the router API: POST /payments with the api-key header from your backend.
- Configure routing rules, smart retries, and use the vault for card tokens.
- Keep the admin API key on your server; it is only for admin endpoints, never expose it in client code.
- Send a test payment from your backend and check the router's /health/ready endpoint for database, Redis, and analytics status.
How to self host Hyperswitch on other VPS Services (Hyperswitch self hosting guide)
Clone the Repository
Clone the official repo and move into it.
git clone https://github.com/juspay/hyperswitch
cd hyperswitch
Install Dependencies
Install Docker and Docker Compose. The repo includes a scripts/setup.sh helper that checks prerequisites and prepares environment files, or you can run Docker Compose directly.
Configure Environment Variables
Copy the example environment file, then set PostgreSQL and Redis connection strings, generated API keys, JWT secret, and the 64-character MASTER_ENC_KEY, HASH_KEY, and ENCRYPTION_KEY.
Start the Hyperswitch Application
Bring the stack up with Docker Compose.
docker compose up -d
Migrations run as part of the router startup. Open the control center on port 9000, create a merchant, and call the router API on port 8080.
Official Pricing of Hyperswitch (Hyperswitch pricing)
Hyperswitch is open source and free to self host under the Apache-2.0 license. Self-hosting cost is therefore your compute and database bill.
Hyperswitch cloud vs self hosted comparison (Pricing, features, costs, and more)
The main decision is operational. Juspay's cloud removes upgrades, scaling, and some compliance tooling from your plate. The core feature set is the same: routing, smart retries, vault, and a unified API across 50+ processors.
Monthly cost of self hosting Hyperswitch on Railway
At light use, expect about $15-30 per month for the router, control-center dashboard, Postgres, and Redis. The $5 Railway trial covers initial setup and testing. Processors still charge their own fees.
System Requirements for Hosting Hyperswitch on a VPS
The template runs four services: hyperswitch-router, control-center, Postgres 18, and Redis 8.2. A small VPS with 2 vCPU and 4GB RAM handles test traffic and light production.
Frequently Asked Questions (FAQs)
Can I run this template in production?
It ships the full Hyperswitch v1.128.0 router and control center, but live card data puts you in PCI DSS scope. Use test mode or handle compliance before processing real charges.
What happens if I lose MASTER_ENC_KEY?
Stored encrypted data becomes unreadable, so back up MASTER_ENC_KEY, HASH_KEY, and ENCRYPTION_KEY right after the first deploy.
Does Railway run the database migrations automatically?
Yes. The router entrypoint maps the Railway Postgres settings and applies all migrations before the service starts.
Do processors still charge fees when Hyperswitch is self hosted?
Yes. Hyperswitch is free to self host, but Stripe, Adyen, and other connected processors still bill their own rates.
Can I connect a processor after the initial deploy?
Yes. Sign up on the control center, create a merchant and profile, connect a processor with sandbox or live keys, then create an API key.
Is the admin API key safe to use from my frontend?
No. Keep the generated admin key server side. Client calls should use a merchant API key from the control center.
Template Content
Redis
redis:8.2.10hyperswitch-router
ghcr.io/onepush-dev/hyperswitch-router:v1.128.0control-center
juspaydotin/hyperswitch-control-center:v1.38.10