Deploy Deploy and Host Medusa.js v2 on Railway
Self-host Medusa.js v2. Zero transaction fees. Own your store data.
Just deployed
Redis
Just deployed
/data
Just deployed
/var/lib/postgresql/data
Deploy and Host Medusa.js v2 on Railway

Medusa.js v2 is the open-source headless commerce engine with 34k+ GitHub stars, an MIT license, and zero per-transaction platform fees — adopted by Heineken, Mitsubishi, and Tekla. A TypeScript + Node.js backend that exposes Store, Admin, and Workflow APIs for any frontend (Next.js, Remix, mobile, POS), with every commerce primitive — products, carts, orders, payments, fulfillment, inventory — as a swappable independent module.
Shopify charges 0.5–2% per transaction on top of $29–$299/month. On $500k annual GMV that's up to $10,000 in platform fees before a single subscription payment. Medusa on Railway costs ~$10–15/month flat. Your revenue. Your data. Your codebase.
What This Template Deploys
| Service | Purpose |
|---|---|
| Medusa v2.15.3 | Headless commerce backend — Store API, Admin API, Workflow engine, and admin dashboard at /app on port 9000 |
| PostgreSQL (SSL) | Primary commerce database — products, orders, carts, customers, inventory, and all transactional data |
| Redis 8.2.1 | Event bus, cache layer, and workflow engine state — required for durable retryable commerce workflows |
All three services connect over Railway's private internal network. DATABASE_URL and
REDIS_URL are injected automatically. JWT_SECRET, COOKIE_SECRET, and CORS headers are
auto-generated at deploy time — zero .env editing required.
About Hosting Medusa.js v2
Running Medusa v2 in production requires coordinating a Node.js application server, PostgreSQL database, and Redis queue — plus generating cryptographic secrets, configuring CORS for your storefront domains, and running database migrations on every deployment. Without a managed host, you're managing Docker Compose, SSL, secret rotation, and migration scripts manually.
This template handles all of it — auto-generated secrets, pre-configured CORS, and
medusa db:migrate on every deploy. Fork the source repo to add modules or workflows;
Railway auto-deploys on every git push.
Typical cost: ~$10–15/month on Railway's Hobby plan. Shopify Basic costs $29/month plus 2% per transaction. WooCommerce scales poorly past 10k orders. Medusa eliminates platform transaction fees — you pay only Stripe's 2.9% + $0.30.
Deploy in Under 5 Minutes
- Click Deploy on Railway — Medusa, PostgreSQL, and Redis build automatically (~3–5 min)
- Set
MEDUSA_ADMIN_EMAILandMEDUSA_ADMIN_PASSWORDin the Variables tab - Wait for the healthcheck at
/healthto go green - Open
[your-domain]/app— the Medusa admin dashboard loads immediately - Go to Settings → Regions to configure currencies, then Settings → Publishable API Keys to get your storefront key
- Connect any frontend — Next.js Commerce, Remix, or a custom storefront via Store API
No SSH. No migration scripts. No secret management.

Common Use Cases
- Self-hosted alternative to Shopify — eliminate 0.5–2% transaction fees and $29–299/month subscriptions; your Medusa backend connects directly to Stripe with no platform cut on revenue
- Self-hosted alternative to Shopify Plus — Shopify Plus starts at $2,300/month; Medusa gives enterprise-grade multi-region, B2B, and marketplace capability at flat compute cost
- Headless Next.js e-commerce backend — pair Medusa's Store API with Next.js Commerce on Vercel or Railway for a fully composable storefront with sub-100ms API responses
- B2B portal with company accounts and custom pricing — Medusa's B2B starter supports company accounts, quote requests, custom price lists, and net-30 invoicing out of the box
- Multi-vendor marketplace — Mercur (built on Medusa v2) is a production-ready marketplace framework for multi-seller storefronts with split payments and seller dashboards
- Shopify migration for scaling brands — brands outgrowing Shopify's transaction fees or API rate limits migrate backend-first; Medusa's REST API mirrors Shopify's surface closely
Configuration
| Variable | Required | Description |
|---|---|---|
MEDUSA_ADMIN_EMAIL | ✅ Required | Initial admin login email |
MEDUSA_ADMIN_PASSWORD | ✅ Required | Initial admin password — set before first boot |
JWT_SECRET | ✅ Auto-generated | Signs admin and customer JWTs |
COOKIE_SECRET | ✅ Auto-generated | Signs admin session cookies |
DATABASE_URL | ✅ Auto-injected | PostgreSQL SSL connection string |
REDIS_URL | ✅ Auto-injected | Redis URI — includes ?family=0 for Railway compatibility |
STORE_CORS | ✅ Auto-set | CORS allowlist for your storefront domain |
ADMIN_CORS | ✅ Auto-set | CORS allowlist for the admin dashboard |
AUTH_CORS | ✅ Auto-set | CORS allowlist for auth endpoints |
MEDUSA_WORKER_MODE | Optional | shared (default), server, or worker for scaled deployments |
DISABLE_MEDUSA_ADMIN | Optional | Set to true to disable the admin UI in headless-only deployments |
Medusa.js v2 vs. Alternatives
| Medusa (Railway) | Shopify Basic | Shopify Plus | WooCommerce | |
|---|---|---|---|---|
| Monthly platform cost | ~$10–15 | $29/month | From $2,300/month | Hosting cost |
| Transaction fee | ✅ None | ❌ Up to 2% | ❌ 0.25% | ✅ None |
| $500k GMV fee | ✅ $0 | ❌ Up to $10,000 | ❌ $1,250 | ✅ $0 |
| Open source / MIT | ✅ Yes | ❌ No | ❌ No | ✅ GPL |
| Data ownership | ✅ Your PostgreSQL | ❌ Shopify servers | ❌ Shopify servers | ✅ Your DB |
| B2B out of the box | ✅ Yes | ❌ App required | ✅ Yes | ❌ Plugin required |
| Workflow engine | ✅ Durable + retryable | ❌ No | ❌ No | ❌ No |
| Multi-region | ✅ Native | ⚠️ Shopify Markets | ✅ Yes | ❌ Plugin required |
| API-first | ✅ REST + events | ⚠️ Storefront API only | ✅ Yes | ❌ Limited REST |

Dependencies for Medusa.js v2 Hosting
- Railway account — Hobby plan (~$10–15/month) for the full three-service stack
- Stripe account for payment processing (2.9% + $0.30 — no additional platform fee)
- A storefront — Next.js Commerce, custom React/Remix app, or mobile frontend
Deployment Dependencies
- Medusa GitHub Repository — source and releases
- Medusa Documentation — full API and module reference
- Next.js Commerce Starter — storefront
- Medusa B2B Starter — B2B portal starter
- Mercur Marketplace — multi-vendor marketplace on Medusa v2
Implementation Details
Deploys Medusa v2.15.3 from praveen-ks-2001/medusa-railway alongside PostgreSQL SSL and
Redis over Railway's private network. medusa db:migrate runs on every deploy automatically.
Fork the repo to add modules or custom endpoints — Railway auto-deploys on git push.
Frequently Asked Questions
How much does Medusa save vs Shopify on transaction fees? Shopify Basic charges up to 2% per transaction without Shopify Payments. On $500k GMV that's $10,000 in fees per year. On $1M GMV it's $20,000. Medusa on Railway costs ~$120–180/year in compute — you pay only Stripe's standard 2.9% + $0.30 per transaction with no platform cut on top. The break-even point against Shopify is well under $10,000 annual GMV.
How is Medusa different from WooCommerce or PrestaShop? Medusa is API-first and headless — there's no bundled frontend. You build or use any storefront that calls the Store API. WooCommerce is a WordPress plugin that couples frontend and backend; it struggles past 10,000 orders and requires plugin management for basic features. Medusa's modular architecture handles multi-region, B2B, marketplace, and subscription use cases natively without plugins.
Do I need a developer to use Medusa?
The admin dashboard at /app handles product management, orders, customers, inventory, and
promotions without code. You need a developer to build and deploy your storefront — Medusa
provides no hosted storefront. Use the Next.js Commerce starter for the fastest frontend
setup.
Does my store data stay private? Yes. All product data, order history, customer records, and transactional data are stored in your Railway PostgreSQL instance. Medusa does not share commerce data with third-party analytics or advertising platforms. You own the schema and can export or migrate at any time.
Can I migrate from Shopify to Medusa? Yes. Export products, customers, and orders from Shopify as CSV and import via Medusa's bulk import tools or REST API. The Medusa docs include a Shopify migration guide.
How do I update to a newer Medusa version?
Update the medusa package version in your forked repo's package.json and push to your
branch. Railway triggers a rebuild automatically. medusa db:migrate runs on startup to
apply any schema changes. Review the Medusa changelog before major version bumps.
Why Deploy and Host Medusa.js v2 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 Medusa.js v2 on Railway, you get a production-grade headless commerce backend — modular, API-first, MIT-licensed, with zero transaction fees and full ownership of your product catalogue, order history, and customer data — at ~$10–15/month flat.
Template Content
MEDUSA_ADMIN_EMAIL
Initial admin user email. Login at /app
MEDUSA_ADMIN_PASSWORD
Initial admin user password. Login at /app
Redis
redis:8.2.1