For Shopify Hydrogen
Host Hydrogen yourself, leave checkout to Shopify
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 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
Shoppers
resolved by Edge DNS
shop.acme.com
hashed assets + cacheable HTML
img.acme.com
cdn.shopify.com, resized at edge
node server.mjs :3000
Hydrogen on the Node adapter, under PM2
form actions
newsletter and contact posts scored
acme.myshopify.com
products, collections, cart
Shopify checkout
payments and orders stay in Shopify
- 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
- 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.
.envPUBLIC_STORE_DOMAIN=acme.myshopify.com PUBLIC_STOREFRONT_API_TOKEN=<public-token> PRIVATE_STOREFRONT_API_TOKEN=<private-token> SESSION_SECRET=<random-string> - 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" - 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.tstype 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} /> - 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
- 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
Estimated monthly bill on Edge
Hydrogen storefront, ~200k visits a month, Shopify plan billed separately
- 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
FAQ
Shopify Hydrogen on Edge, answered
Why self-host instead of using Oxygen?
Is self-hosting Hydrogen supported?
How does Hydrogen talk to Shopify?
What happens to caching outside Oxygen?
How do I ship updates?
Drop-in services
Add these without touching the stack
- Edge ShieldBot protection
POST /siteverify → score: 94Score newsletter, contact and account form submissions inside your route actions, with one server-side fetch.
Free for most sites. No puzzles, no widget to style.Explore - Edge AssistAI answers
<script src="…/assist.js">Answers product and policy questions from your storefront routes, without a support ticket.
Free tier: 250 answered questions a monthExplore
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.