Skip to content

For Shopify Hydrogen

Host Hydrogen yourself, leave checkout to Shopify

Run your Hydrogen storefront as a Node server on a real VM and cache its assets across 988 locations. Shopify keeps the catalogue, cart, checkout and orders; you keep the front end.

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

Why Shopify Hydrogen on Edge

Move the front end, leave the back office in Shopify

Shopify keeps inventory, payments and orders. Self-hosting changes where the React server runs, and nothing else.
  • Shopify stays the source of truth

    Hydrogen reads products and carts through the Storefront API. Inventory, checkout, payments and orders stay in Shopify.
  • A normal Node server

    Build with a Node adapter and run it under PM2 or systemd. A long-running process, with the full Node API.
  • Assets from the edge

    Hashed JS and CSS bundles and cacheable pages are served from 988 locations. Personalised routes render on the VM.
  • Product images on your domain

    Proxy cdn.shopify.com through the Edge CDN and point Hydrogen's <Image> loader at it for AVIF and WebP from one hostname.
  • Room for the rest

    The same VM can run your blog, a headless CMS or internal tools beside the storefront, on one bill.
  • Deploy from any CI

    GitHub Actions, GitLab CI or plain SSH. The Edge CLI handles VMs, domains and cache purges.

Reference architecture

A Node VM renders, Shopify does the commerce

A small Node VM running the Hydrogen server, fronted by the CDN. Shopify handles the commerce; Edge handles your customers' page loads.
  • Compute

    Runs the Hydrogen server as a long-running Node process.

  • CDN

    Caches hashed build assets and cacheable pages worldwide.

  • Image optimisation

    Resizes Shopify product images to AVIF and WebP on your own image domain.

  • DNS

    Anycast DNS for the apex storefront, www and the image subdomain.

  • Shield

    Scores storefront form submissions inside your route actions.

  • Assist

    Answers product and policy questions from your storefront routes.

Deploy

Hydrogen on a VM with the Node adapter

Build with the Node adapter, copy the output to a VM, and put the CDN in front. The storefront code doesn't change.
  1. 01

    Set the Storefront API credentials

    Create the tokens in the Hydrogen or Headless channel in Shopify admin. On Node, pass Hydrogen's InMemoryCache to createStorefrontClient for sub-request caching.

    .env
    PUBLIC_STORE_DOMAIN=acme.myshopify.com
    PUBLIC_STOREFRONT_API_TOKEN=<public-token>
    PRIVATE_STOREFRONT_API_TOKEN=<private-token>
    SESSION_SECRET=<random-string>
  2. 02

    Build and start on a VM

    The nodejs library script installs Node 22, PM2 and an Nginx reverse proxy on first boot.

    shell
    $ npm run build
    $ edge compute create --name storefront --size s-2vcpu-4gb \
        --image ubuntu-24 --region london --script nodejs
    
    $ rsync -a dist server.mjs package*.json .env root@<vm-ip>:/srv/shop/
    $ ssh root@<vm-ip> "cd /srv/shop && npm ci --omit=dev \
        && pm2 start server.mjs --name hydrogen"
  3. 03

    Serve product images from your domain

    Keep the <Image> component. A custom loader rewrites Shopify image URLs to your CDN domain and asks for the size it needs.

    app/lib/edge-loader.ts
    type LoaderArgs = { src?: string; width?: number }
    
    export function edgeLoader({ src, width }: LoaderArgs) {
      const { pathname } = new URL(src!)
      return `https://img.acme.com${pathname}?width=${width}&format=auto`
    }
    
    // <Image data={product.featuredImage} loader={edgeLoader} />
  4. 04

    Put the CDN in front

    One deployment, two domains: the storefront from your VM and product images proxied from Shopify's CDN.

    shell
    $ edge cdn create --name acme-hydrogen
    $ edge cdn domains add cdn-a1b2c3 --domain shop.acme.com \
        --origin https://<vm-ip>
    $ edge cdn domains add cdn-a1b2c3 --domain img.acme.com \
        --origin https://cdn.shopify.com --jit-image

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

What it costs

The storefront for about $20 a month

One VM and a CDN deployment. Your Shopify subscription carries on as before; this is only the front end.
  • Shopify bills your plan and payments as usual
  • Image transforms included with the CDN
  • Billed hourly from a prepaid balance
  • Standard Node: move hosts whenever you like
See compute pricing

Estimated monthly bill on Edge

Hydrogen storefront, ~200k visits a month, Shopify plan billed separately

USD
  • Compute$19.24Standard VM: 2 vCPU, 4 GiB, 80 GB NVMe
  • CDN$1.004.5M requests incl. image variants: first 500k free, then 4M × $0.25/M
  • DNS$0.00Apex, www and img records
  • Egress$0.00
Total$20.24

FAQ

Shopify Hydrogen on Edge, answered

Something else? Ask an engineer.
Why self-host instead of using Oxygen?
Oxygen is a good default and is included with most Shopify plans. Self-hosting makes sense when you want a long-running Node process, other services beside the storefront, your own CDN and image domain, or one deploy pipeline for everything. The trade-off is that you own deploys and uptime.
Is self-hosting Hydrogen supported?
Yes. Hydrogen is open source, and Shopify documents deploying it to platforms other than Oxygen, including Node through an adapter. You still need a Shopify store; checkout always stays on Shopify.
How does Hydrogen talk to Shopify?
Through the Storefront API, plus the Customer Account API for signed-in features. Both are hosted by Shopify. Edge hosts the React front end that calls them.
What happens to caching outside Oxygen?
Hydrogen's caching strategies still apply. On Node, give createStorefrontClient an in-memory or Redis-backed cache, and let the CDN cache hashed assets and any pages you mark as public.
How do I ship updates?
Build, sync the output to the VM and restart the PM2 process, then purge the CDN paths that changed. The same workflow as our Node.js and Next.js pages.

Deploy Hydrogen from your own pipeline

Start free. Move the storefront; your Shopify admin, apps and checkout stay exactly as they are.

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