Skip to content

For Medusa

Medusa 2 on your own VMs, Postgres next door

Medusa, Postgres and Redis on real VMs, product media in an S3-compatible bucket and your storefront cached across 988 locations. The bill doesn't grow with your order count.

Free to sign up. No egress fees on any product.

Why Medusa on Edge

Medusa runs here the way it runs on your laptop

A real VM with a long-running Node process, next to a real Postgres. No platform layer to learn, nothing metered per order.
  • Node, Postgres and Redis

    Medusa server and worker on one VM, Postgres on another, joined by a free private network. Split further as you grow.
  • The S3 file provider, unchanged

    Point Medusa's file-s3 provider at Edge Storage. Product images and digital goods land in a bucket, not on the VM.
  • Any storefront you like

    Medusa is API-first. Run the Next.js starter on its own VM, or pair it with Nuxt, SvelteKit or Astro.
  • Catalogue at the edge

    Storefront pages, static assets and product media cache in 988 locations. Carts and checkout go straight to origin.
  • Bring your own payments

    Stripe, PayPal and the other payment providers work exactly as documented. Money moves between Medusa and your gateway.
  • Agent-deployable

    Ask your coding agent to deploy a Medusa store to shop.acme.com. The agent API stands up the VMs, bucket, DNS and CDN.

Reference architecture

Medusa behind the storefront, data on a private network

Storefront and Medusa on separate VMs, the data tier on a private network, media in a bucket and the CDN in front of everything public.
  • Compute

    Runs the Medusa server and worker, the storefront and Postgres on separate VMs.

  • Storage

    Holds product imagery, uploads and downloadable goods behind the file-s3 provider.

  • CDN

    Caches storefront pages, static assets and media URLs worldwide.

  • Image optimisation

    Resizes and converts product images on request, instead of at upload.

  • DNS

    Anycast DNS for shop., api. and media. subdomains.

  • Shield

    Scores cart completion and customer signup calls from the storefront.

  • Assist

    Answers shipping, stock and returns questions from storefront content.

Deploy

A Medusa 2 store with the standard CLI

Two VMs, one config block and the standard Medusa CLI. Add the storefront VM the same way as the Next.js page describes.
  1. 01

    Create the database and Medusa VMs

    The postgresql script installs PostgreSQL 16 with remote access. Attach both VMs to one private network, then allow 5432 from that range only.

    shell
    $ edge compute create --name medusa-db --size s-2vcpu-4gb \
        --image ubuntu-24 --region london --script postgresql \
        --script-param db_name=medusa
    
    $ edge compute create --name medusa --size s-4vcpu-8gb \
        --image ubuntu-24 --region london --script nodejs
  2. 02

    Point the file module at Edge Storage

    Medusa 2 ships an S3 file provider. Path-style addressing and the Edge endpoint are the only changes from AWS.

    medusa-config.ts
    modules: [{
      resolve: "@medusajs/medusa/file",
      options: {
        providers: [{
          resolve: "@medusajs/medusa/file-s3",
          id: "s3",
          options: {
            bucket: "medusa-media",
            region: "us-east-1",
            endpoint: "https://storage.edge.network",
            file_url: "https://media.acme.com",
            access_key_id: process.env.S3_ACCESS_KEY_ID,
            secret_access_key: process.env.S3_SECRET_ACCESS_KEY,
            additional_client_config: { forcePathStyle: true },
          },
        }],
      },
    }],
  3. 03

    Migrate, build and start

    Redis lives on the Medusa VM and listens on localhost. The production server runs from .medusa/server under PM2.

    shell
    $ apt install -y redis-server
    $ echo "DATABASE_URL=postgres://<user>:<pw>@10.185.0.2/medusa" >> .env
    $ echo "REDIS_URL=redis://localhost:6379" >> .env
    
    $ npx medusa db:migrate && npx medusa build
    $ cp .env .medusa/server/.env.production
    $ cd .medusa/server && npm install
    $ NODE_ENV=production pm2 start npm --name medusa -- start
  4. 04

    Front the storefront and media with the CDN

    Product images then resize from the URL: media.acme.com/tee.jpg?width=800&format=auto.

    shell
    $ edge cdn create --name acme-store
    $ edge cdn domains add cdn-a1b2c3 --domain shop.acme.com \
        --origin https://<storefront-ip>
    $ edge cdn domains add cdn-a1b2c3 --domain media.acme.com \
        --origin-type storage --storage-bucket medusa-media --jit-image

Prefer to hand it off? Give the job to your AI agent or have our engineers do it.

What it costs

A full Medusa stack, priced line by line

Three VMs, a CDN deployment and a bucket. Nothing on the invoice grows with orders, API calls or admin seats.
  • No per-order, per-request or per-seat fees
  • Private network traffic between VMs is free
  • Payment providers bill you directly
  • Billed hourly from a prepaid balance
See compute pricing

Estimated monthly bill on Edge

Medusa 2 store with a Next.js storefront, ~100k visits a month

USD
  • Medusa VM$38.47Performance: 4 vCPU, 8 GiB for server, worker and Redis
  • Database VM$19.24Standard: 2 vCPU, 4 GiB for PostgreSQL 16
  • Storefront VM$19.24Standard: 2 vCPU, 4 GiB for the Next.js starter
  • CDN$0.502.5M requests: first 500k free, then 2M × $0.25 per million
  • Storage$0.3025 GB of product media: first 5 GB free, then 20 GB × $0.015
  • Egress$0.00
Total$77.75

FAQ

Medusa on Edge, answered

Something else? Ask an engineer.
Medusa 1.x or 2.x?
2.x is the current, modular release and the one to pick for anything new. Existing 1.x stores run too; they use the medusa-file-s3 plugin rather than the file-s3 module provider. The hosting pattern is the same.
How does this compare to Medusa Cloud?
Same open-source software, but you control the host. You get root access, a bill that doesn't move with traffic, and the storefront, API and database on one private network.
Which storefront framework should I use?
Whichever your team knows. Medusa's starter is Next.js, but the Store API works with anything. We have pages for Next.js, Nuxt, SvelteKit and Astro.
How do I scale beyond this?
Run the Medusa worker on its own VM, add storefront VMs behind the CDN, and give Redis a dedicated VM. Everything talks over the private network, so nothing else changes.
Can the CDN cache the Store API?
Public, read-only product and collection routes can be cached with short TTLs. Cart, checkout, customer and admin routes should always go to origin. Most teams cache in the storefront and let the CDN handle pages and media.

Put your Medusa store on VMs you control

Start free. Bring an existing Medusa store or scaffold a new one with create-medusa-app.

Free tiers hard-cap. Nothing bills until you add a card.