---
title: "Deploy Hyperswitch"
description: "Open-source payments switch: one API for Stripe, Adyen, PayPal, 100+ more"
category: "Other"
url: https://railway.com/deploy/hyperswitch-server
---

# Deploy Hyperswitch

Open-source payments switch: one API for Stripe, Adyen, PayPal, 100+ more

**[Deploy Hyperswitch on Railway](https://railway.com/template/hyperswitch-server)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/hyperswitch-server/manifest.json

- **Creator:** Two Workspaces
- **Category:** Other

## Template content

### Redis https://devicons.railway.app/i/redis.svg

- **Image:** redis:8.12.0-alpine
- **Start command:** `/bin/sh -c "chown -R redis:redis /data && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --appendonly yes"`

### Dashboard https://raw.githubusercontent.com/two-workspaces/hyperswitch/main/icon.png

- **Image:** juspaydotin/hyperswitch-control-center:v1.40.0
- **Health check:** /health
- **Public domain:** Yes

### Hyperswitch https://raw.githubusercontent.com/two-workspaces/hyperswitch/main/icon.png

- **Source:** https://github.com/two-workspaces/hyperswitch
- **Health check:** /health
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** postgres:17.12-alpine

## Documentation

# Deploy and Host Hyperswitch on Railway

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/hyperswitch-server)

[Hyperswitch](https://github.com/juspay/hyperswitch) is an open-source payments switch from Juspay: one API and one dashboard in front of Stripe, Adyen, PayPal, Checkout.com, Braintree and 100+ other processors, with smart routing between them, retries, refunds, payouts, saved cards, fraud checks and webhooks. It is licensed Apache-2.0. This template runs Hyperswitch v1.131.0 on Railway: the payments API, the Control Center dashboard, Postgres and Redis, with the admin ready on the first boot and self sign-up closed.

This is a community template, not made or supported by Juspay.

## About Hosting Hyperswitch

Before deploying, set `ADMIN_EMAIL` on the Hyperswitch service to your email. Deploy, wait for the green checks (the first boot runs the database migrations and creates the admin, a minute or two), and open the **Dashboard** service's Railway domain. Sign in with `ADMIN_EMAIL` and the generated `ADMIN_PASSWORD`, both on the Hyperswitch service's Variables tab. The Dashboard offers to set up two-factor sign-in; do it, or skip it for now.

**Why the admin is created for you and sign-up is off:** Hyperswitch lets anyone who opens the dashboard sign up and get their own merchant account. The template creates your admin through a router that only listens inside the container, then starts the public one with sign-up refused by the API (not just hidden). Invite teammates from the Dashboard under Users; set `ALLOW_SIGNUP=true` only if you really want open registration.

**Trying a payment without a processor account:** in the Dashboard open Connectors > Payment Processors, turn on test processors and connect one of Hyperswitch's dummy processors (for example the Stripe or PayPal dummy, `stripe_test` / `paypal_test` in the API). Then create an API key under Developers > API Keys and send a payment:

```
curl https://‹your-api-domain›/payments \
  -H "api-key: ‹your API key›" -H "Content-Type: application/json" \
  -d '{"amount": 6540, "currency": "USD", "confirm": true, "capture_method": "automatic",
       "payment_method": "card", "payment_method_type": "credit",
       "payment_method_data": {"card": {"card_number": "4242424242424242", "card_exp_month": "10",
         "card_exp_year": "30", "card_holder_name": "Test", "card_cvc": "123"}}}'
```

For real money, connect your processor with its live credentials instead; Hyperswitch passes the card data through to it.

**Two addresses:** the **Hyperswitch** service is the payments API your backend and the Web SDK call (`https://‹api-domain›/payments`, `/refunds`, …, plus `/health`), and the **Dashboard** service is the Control Center for people. Your backend authenticates with a merchant API key in the `api-key` header. `ADMIN_API_KEY` is the separate key for Hyperswitch's admin API (creating merchant accounts by API, sent as `Authorization: admin-api-key=‹key›`), so keep it out of client code.

**Your data:** merchants, connectors, payments, refunds and users are in the Postgres service, on its volume; Redis holds caches and short-lived locks; uploaded dispute evidence and themes are on the Hyperswitch service's small volume. Redeploys keep them. Migrations of the running release apply on every start, so an upgrade migrates the database by itself.

**Keep the keys:** `MASTER_ENC_KEY`, `API_KEY_HASH_KEY` and `USER_AUTH_ENCRYPTION_KEY` are generated once. Merchant data, API keys and sign-in settings are encrypted or hashed with them, so the service refuses to start (and says why) if one of them changes after the first boot. Back them up together with the database.

**Custom domains:** add them under each service's Settings > Networking, then set `PUBLIC_URL` on the Hyperswitch service and `default__endpoints__api_url` on the Dashboard to the API's domain, and `CONTROL_CENTER_URL` to the Dashboard's.

## Common Use Cases

- One payments API for several processors, so you can add or switch one without rewriting checkout
- Routing payments by cost, success rate, country or card brand, with automatic retries on another processor
- A self-hosted, PCI-ready alternative to a payment orchestration SaaS
- Refunds, payouts, disputes and saved cards managed from one dashboard
- Testing a payments integration end to end with the built-in dummy processors before signing a processor contract

## Dependencies for Hyperswitch Hosting

- Postgres and Redis (both included)
- An account with at least one payment processor for real payments (dummy test processors are built in)

### Deployment Dependencies

- [Hyperswitch on GitHub](https://github.com/juspay/hyperswitch)
- [Hyperswitch documentation](https://docs.hyperswitch.io)
- [Control Center on GitHub](https://github.com/juspay/hyperswitch-control-center)
- [Template source](https://github.com/two-workspaces/hyperswitch)

### Implementation Details

- **Services:** Hyperswitch (the router, i.e. the payments API, on port 8080), Dashboard (the Control Center, on port 9000), Postgres 17 and Redis 8.
- **Images:** a small wrapper on upstream's pinned `juspaydotin/hyperswitch-router:v1.131.0-standalone` that adds the same release's migrations (run with diesel on every start) and config; the Dashboard is the stock `juspaydotin/hyperswitch-control-center:v1.40.0`, configured by variables.
- **Superposition:** v1.131.0 won't start without a Superposition config server. Instead of running one, the router reads the release's bundled seed file (with an upstream duplicate-position bug fixed at build time), and a tiny stub on 127.0.0.1 answers the one experiments request the router insists on with "no experiments".
- **Payment callbacks:** the router also refuses to start without a `payment_callback` policy, which no migration adds; the first boot sets it to `enforced` (every callback URL carries a single-use token). Change it with Hyperswitch's configs API if you need `migration` or `legacy`.
- **Memory:** at rest the API uses about 55 MB, the Dashboard 65-80 MB, Postgres 60-70 MB and Redis under 10 MB; 200 test payments, 20 at a time, stayed under 0.2 GB per service with every service capped at 0.5 GB.
- **Left out on purpose:** the scheduler (producer and consumer: delayed retries, payment status sync and outgoing webhook retries), the drainer (only for KV mode), the Web SDK server, Kafka, ClickHouse and OpenSearch analytics, and the monitoring stack. Payments, refunds, connectors, routing and the Dashboard work without them.
- **No email:** upstream's standalone build has no email feature, so there are no magic links, email verification or password-reset mails; teammates are invited from the Dashboard.
- **Never crash-looping on a variable:** if a database or Redis variable, a key, an address or the admin's email or password is wrong, or a migration fails, the service shows a page saying what to fix instead of restarting over and over, and the deploy logs say the same.

## Why Deploy Hyperswitch 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 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.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — Self-hosted virtual tabletop for role-playing games (license required)
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/hyperswitch-server
