For Medusa
Medusa on Edge,
the Shopify alternative for devs
Self-host the modern open-source commerce stack on real VMs. Node.js + Postgres + Redis, S3-compatible product imagery, global CDN — your storefront, your code, your data.
# medusa-config.js — file plugin (1.x)
module.exports = {
plugins: [
{
resolve: 'medusa-file-s3',
options: {
s3_url: 'https://cdn.example.com',
bucket: 'medusa-assets',
endpoint: 'https://storage.edge.run',
},
},
],
}
# Provision the VM
$ edge compute create --plan small ...
Why Medusa teams pick Edge
A real VM means Medusa runs the same as on your laptop — and pairs naturally with our existing JS stack pages.
Node.js + Postgres + Redis
A small VM runs the entire core stack. Scale Postgres and Redis to dedicated VMs via private networking when you grow.
S3 file plugin
Wire `medusa-file-s3` (or the AWS S3 module in Medusa 2.x) to Edge Storage. Product imagery and uploads land in a CDN-fronted bucket.
Storefront, your framework
Medusa is API-first. Pair the backend with a Next.js, Nuxt or Astro storefront on its own Edge VM (or static-host it from Storage).
Global CDN for the API and shop
Cache the catalogue endpoints aggressively at the Edge CDN. Cart and checkout calls fall through to your origin region.
Bring your own payments
Stripe, PayPal, Klarna, Adyen — all the official payment provider modules work the same as on Medusa Cloud or your laptop.
Agent-deployable
"Deploy a Medusa store to shop.example.com" — the Edge agentic API can stand up the VM, DB, file bucket and storefront in one go.
Reference architecture
How Medusa maps to Edge
Medusa core as the API origin, Postgres and Redis on the same or adjacent VMs, your storefront framework of choice on its own VM or in Storage.
Runs Medusa core (Node.js) + Postgres + Redis on a VM
S3-compatible bucket for product imagery and downloadable goods
Caches the public storefront, catalogue API and asset URLs
Optional: replace built-in resizing with edge transforms
Anycast DNS for `shop.`, `cms.` and `admin.` subdomains
# Next.js storefront → Medusa on Edge
import Medusa from '@medusajs/medusa-js'
const medusa = new Medusa({
baseUrl: 'https://api.shop.example.com',
maxRetries: 3,
})
# Cached via Edge CDN
const { products } = await medusa.products.list()
Common questions
Medusa 1.x or 2.x?
Both run cleanly on Edge. 2.x is the modular architecture (recommended for new projects); 1.x is fine if you already have a stack you're happy with. Same hosting story for both.
How does this compare to Medusa Cloud?
Same software, you control the host. Self-hosting on Edge gives you predictable bills at any scale, root access, and the ability to colocate storefront and core on the same private network.
Which storefront framework should I use?
Whichever you prefer — Medusa's starter is Next.js, but the API works with anything. We have stack pages for Next.js, Nuxt, SvelteKit, Astro and more.
How do I scale beyond a single VM?
Move Postgres and Redis to dedicated VMs over private networking, run the storefront on its own VM(s), and use the CDN to absorb spike traffic. The same architecture pattern as a hyperscaler — without the bill.
By Stack
Other stacks on Edge
Ship Medusa on Edge
30-day trial. Bring an existing Medusa store or scaffold a new one with the official starter.