You're staring at your Shopify bill — $79 this month, plus a 0.5% transaction fee on every order because you're not on Shopify Payments. For a store doing $8,000 a month, that fee alone is $40 gone before you pay for a single app. Sound familiar?
That's exactly where I was with my second store before I started digging into open-source commerce backends. Medusa.js kept coming up, and after running it in production for about eight months, I can tell you it's one of the most underrated options for small stores that want real control without a six-figure dev budget.
This tutorial walks you through what Medusa.js actually is, whether it makes sense for your situation, and the concrete steps to get a working storefront live for less than $20 a month.
What Medusa.js Is (and Isn't)
Medusa.js is an open-source, Node.js-based commerce engine. Think of it as the brain behind your store — it handles products, inventory, orders, customers, discounts, and cart logic through a REST API. It is not a drag-and-drop website builder. You bring your own frontend.
That distinction matters. If you want a pixel-perfect storefront with no coding, Medusa is probably not your weekend project. But if you're comfortable editing a config file, copying a terminal command, or working with a developer even part-time, you can absolutely run this.
The payoff: no per-transaction fees to the platform, no mandatory app store for basic features, and the ability to deploy your backend anywhere that runs Node — a $6 DigitalOcean droplet, Railway, Render, you name it.
The $20/Month Stack That Actually Works
Before we touch a command line, let's talk money, because that's what makes or breaks a decision for a small store.
Here's the stack I recommend for a store doing up to roughly $30,000/month in GMV:
- Medusa backend on Railway's Starter plan — free tier covers hobby use; $5–10/month for a persistent always-on service
- PostgreSQL database via Railway's managed add-on — included in the same $5–10 spend
- Redis for the job queue — Railway again, or Upstash's free tier (10,000 commands/day free)
- Next.js storefront on Vercel's Hobby plan — free for personal/small commercial use
- Cloudinary free tier for image hosting — 25 GB storage, 25 GB bandwidth/month free
Total: roughly $5–15/month depending on traffic. Even if you bump to Railway's Pro plan at $20/month for more resources, you're still well under what most Shopify stores pay in app subscriptions alone.
One honest caveat: email for transactional notifications (order confirmations, shipping updates) needs a service like Resend or SendGrid. Resend's free tier covers 3,000 emails/month, which is plenty to start.
Setting Up Your Medusa Backend Step by Step
Alright, let's get into it. You'll need Node.js 18+ and npm installed locally. If you haven't done that yet, the official Node.js site has a one-click installer for every OS.
Step 1 — Scaffold the project
Open your terminal and run:
npx create-medusa-app@latest my-store
The CLI will ask if you want a storefront included. Say yes and pick the Next.js starter — it saves you hours of wiring up cart, checkout, and product pages from scratch.
Step 2 — Configure your environment variables
Inside the generated my-store/backend folder, copy .env.template to .env. You'll fill in:
DATABASE_URL— your PostgreSQL connection stringREDIS_URL— your Redis connection stringJWT_SECRETandCOOKIE_SECRET— generate these withopenssl rand -hex 32twice
Don't skip the secrets step. A predictable JWT secret is a real security hole.
Step 3 — Seed and start locally
cd my-store/backend
npm install
npm run seed
npm run dev
The seed command loads demo products so you can poke around immediately. Your admin dashboard will be at http://localhost:9000/app. Create your admin user when prompted — you'll use this to manage products, orders, and customers going forward.
Step 4 — Start the storefront
In a second terminal:
cd my-store/storefront
npm install
npm run dev
Visit http://localhost:8000 and you'll see a working storefront connected to your local backend. Add something to the cart. It works. That little moment never gets old.
Deploying to Production Without Losing Your Mind
Local dev is satisfying; production is where things get real. Here's the fastest path that doesn't require a DevOps background.
Deploy the backend on Railway
- Push your
backendfolder to a GitHub repo. - Go to railway.app, create a new project, and connect the repo.
- Add a PostgreSQL plugin and a Redis plugin from Railway's marketplace — they auto-inject
DATABASE_URLandREDIS_URLinto your service environment. - Add your remaining environment variables (
JWT_SECRET,COOKIE_SECRET, etc.) in Railway's Variables tab. - Set the start command to
npm run startand deploy.
Railway will give you a public URL like https://my-store-backend.up.railway.app. Copy it — you'll need it in the next step.
Deploy the storefront on Vercel
- Push your
storefrontfolder to its own GitHub repo (or a monorepo — Vercel handles both). - Import the project in Vercel, set the framework to Next.js.
- Add one environment variable:
NEXT_PUBLIC_MEDUSA_BACKEND_URLpointing to your Railway URL. - Deploy. Vercel handles CDN, SSL, and preview deployments automatically.
Total deploy time the first time: about 45 minutes if you've used Railway or Vercel before, maybe 90 minutes if you're new to both. That's a reasonable afternoon.
Customizing Products, Regions, and Payment
Once you're live, the three things you'll configure immediately are your product catalog, regions, and a payment provider.
Products — The admin UI is clean and familiar if you've used Shopify. Add products, variants, and inventory levels from the dashboard. If you have an existing catalog, Medusa's REST API accepts bulk imports via CSV through the admin, or you can script it with a few lines of JavaScript hitting the /admin/products endpoint.
Regions — Medusa's region system lets you set different currencies, tax rates, and shipping options per geography without a plugin. If you only sell in the US, you'll have one region. If you sell globally, add regions and assign countries. This is genuinely better than how most $79/month platforms handle multi-currency.
Payment — Medusa ships with a Stripe plugin that takes about 15 minutes to wire up. Add your Stripe publishable and secret keys as environment variables, install the plugin package, register it in medusa-config.js, and redeploy. Done. Stripe's 2.9% + $0.30 per transaction goes straight to you — no platform cut on top.
Are you selling digital products or subscriptions? Medusa has community plugins for both, though they require a bit more setup than physical goods.
A Real Example: A Candle Store Migration
A friend of mine runs a small candle brand — about 200 orders a month, average order value around $55. She was on Shopify Basic ($39/month) plus three apps totaling $47/month: a review app, a subscription app, and a bundle builder. That's $86/month before transaction fees.
We migrated her to Medusa over a long weekend. Backend on Railway ($10/month), storefront on Vercel (free), Stripe direct, Judge.me reviews embedded via their widget (free tier), and a custom bundle discount built with Medusa's native discount API in about two hours of code.
Her monthly platform cost dropped to $10. She kept her domain, her SEO, and her customer data — all of it exported and reimported cleanly. The storefront is faster too: her Lighthouse performance score went from 61 to 89 after moving to the Next.js static-first frontend.
That's not a guaranteed outcome for every store, but it shows what's possible when you're not renting infrastructure you could own.
Three Things to Do Today
If this sounds worth exploring, here are three actions you can take right now — no commitment required:
-
Run the local setup — The
create-medusa-appcommand takes under five minutes. Just seeing a working store on your laptop tells you a lot about whether this fits your comfort level. -
Audit your current platform bill — List every line item: platform fee, apps, transaction fees, theme licensing. Most store owners I talk to are surprised the number is $150–$300/month once they add it all up. That's your comparison baseline.
-
Read the Medusa docs on plugins — Specifically the payment and fulfillment sections. If your current workflow depends on a specific shipping carrier or ERP integration, confirm there's a Medusa plugin or a REST API you can connect to before you commit to migrating.
You Don't Have to Go All-In at Once
Here's the thing about headless commerce that most tutorials skip: you don't have to migrate everything on day one. Some store owners run Medusa as a backend for a specific sales channel — a wholesale portal, a B2B ordering page, a pop-up shop microsite — while keeping their main storefront on whatever platform is working. That's a completely valid use of the tool.
The goal isn't to use the newest stack. The goal is to stop paying for things you don't need and start owning more of your margin.
If a $10/month backend that you fully control sounds better than a $79/month platform where you're one policy change away from a suspended account, Medusa is worth a Saturday afternoon. Start local, get comfortable, then deploy when it feels right.
Your next step: run npx create-medusa-app@latest and just look around. You might be surprised how close you already are to shipping something.