What Oxygen Actually Does for Your Hydrogen Storefront
Shopify Oxygen is the hosting platform purpose-built for Hydrogen storefronts. While Hydrogen gives you the React-based framework for building custom headless commerce experiences, Oxygen handles deploying and serving those experiences at the edge — across 285+ global locations with sub-second response times.
Think of it this way: Hydrogen is what you build with. Oxygen is where it runs. The two are designed to work together, and the integration between them eliminates most of the DevOps complexity that makes headless commerce intimidating for smaller teams.
What makes Oxygen different from dropping your Hydrogen app on Vercel or Netlify is colocation. When your storefront runs on Oxygen, Storefront API queries happen at localhost speed because your store data and your rendering logic live on the same infrastructure. That architectural advantage is something no third-party host can replicate. If you're exploring headless and Hydrogen approaches for your next Shopify project, understanding Oxygen is essential context.
How the Oxygen Worker Runtime Works
Oxygen is a worker-based JavaScript runtime built on Cloudflare's open-source workerd library. Unlike traditional Node.js servers that run a single long-lived process, Oxygen uses V8 isolates — lightweight execution contexts that spin up in milliseconds and run your code at the network edge.
V8 Isolates vs. Traditional Servers
| Feature | Oxygen (V8 Isolates) | Traditional Node.js Server |
|---|---|---|
| Cold start time | ~5ms | 200-500ms |
| Memory per request | Shared isolate | Full process |
| Global distribution | 285+ edge locations | Single region (unless you configure multi-region) |
| Scaling | Automatic, per-request | Manual or autoscaling policies |
| API colocation | Storefront API at localhost speed | Network hop to Shopify |
Web Standard APIs
Because Oxygen runs on a worker runtime, it uses web-standard APIs rather than Node.js-specific ones. You get access to:
- Fetch API — for making HTTP requests to external services
- Streams API — for handling large responses efficiently
- Cache-Control API — for fine-grained caching at the edge
- Web Crypto API — for cryptographic operations
- URL API — for URL parsing and manipulation
This means code you write for Oxygen is portable. If you ever need to move to Cloudflare Workers or Deno Deploy, most of your logic transfers directly. According to Shopify's engineering blog on how they built Oxygen, the decision to use web-standard APIs was deliberate — it reduces lock-in while optimizing for edge performance.
What You Cannot Use
Oxygen does not support Node.js-specific APIs. This catches developers off guard:
- No
fsmodule (no file system access) - No
child_process(no spawning subprocesses) - No
netordgram(no raw TCP/UDP sockets) - No
__dirnameor__filenameglobals - Limited
Buffersupport (useUint8Arrayinstead)
If your project depends on Node.js packages that use these APIs internally, they will not work on Oxygen without alternatives.
Oxygen Pricing and Plan Availability

One of Oxygen's biggest advantages is cost: it is included at no extra charge on all paid Shopify plans. Here is the breakdown as of 2026.
Which Plans Include Oxygen
| Shopify Plan | Oxygen Access | Notes |
|---|---|---|
| Starter | No | Not available |
| Development stores | No | Not available |
| Basic ($39/mo) | Yes | Included |
| Shopify ($105/mo) | Yes | Included |
| Advanced ($399/mo) | Yes | Included |
| Shopify Plus ($2,300+/mo) | Yes | Priority support |
What Is Included
- Hosting — no separate hosting fees
- Bandwidth — no bandwidth charges
- Storage — no storage fees
- SSL certificates — automatic
- Global CDN — 285+ edge locations included
- Preview deployments — unlimited
Compare this to self-hosting on Vercel, where a production Hydrogen app can easily incur $20-100+/month in function invocations and bandwidth. For merchants already paying for a Shopify plan, Oxygen is effectively free hosting. The Storetasker guide to Oxygen hosting provides additional cost comparison details.
Setting Up Oxygen Deployment Step by Step
Getting your Hydrogen storefront deployed to Oxygen requires connecting your GitHub repository to your Shopify store. Here is the complete process.
Prerequisites
Before starting, verify you have:
- A Shopify store on a paid plan (Basic or above)
- A Hydrogen project initialized with
npx shopify hydrogen init - A GitHub repository containing your Hydrogen code
- Admin access to both Shopify and GitHub
Connect GitHub to Shopify
- Open your Shopify admin and navigate to Sales Channels > Hydrogen
- Click Create storefront and select your GitHub repository
- Choose the branch you want to deploy (typically
mainfor production) - Shopify automatically configures the build pipeline
Configure Environment Variables
Environment variables in Oxygen are managed through the Shopify admin, not through .env files:
- Navigate to Hydrogen > Your Storefront > Settings > Environment variables
- Add variables for each environment (production, preview)
- Critical variables include your
PUBLIC_STOREFRONT_API_TOKENandSESSION_SECRET
PUBLIC_STOREFRONT_API_TOKEN=your-token-here
SESSION_SECRET=your-random-secret
PUBLIC_STORE_DOMAIN=your-store.myshopify.comTrigger Your First Deploy
Push a commit to your connected branch. Oxygen picks it up automatically:
git add .
git commit -m "Initial Hydrogen storefront"
git push origin mainThe build process runs in Oxygen's infrastructure. You can monitor progress in the Shopify admin under Hydrogen > Deployments. According to Shopify's official Hydrogen getting started guide, the first deployment typically takes 2-4 minutes.
CI/CD Pipeline: GitHub Integration Deep Dive

Oxygen's CI/CD integration with GitHub is one of its strongest features. Every push triggers an automated build-and-deploy cycle with preview URLs for every branch.
How the Pipeline Works
Developer pushes to GitHub
→ Oxygen detects the push
→ Runs the build process (vite build)
→ Deploys to edge (production or preview)
→ Posts deployment URL as GitHub commit statusProduction vs. Preview Environments
- Production deployments happen when you push to your designated production branch (usually
main) - Preview deployments happen on every other branch push, giving you a unique URL to test changes
This means every pull request gets its own live URL. Share it with stakeholders, test on mobile devices, run through QA — all before merging to production.
Custom CI/CD Configuration
If you need more control, Oxygen supports custom CI/CD pipelines. You can:
- Run tests before deployment
- Add linting and type-checking gates
- Integrate visual regression testing
- Add custom build steps
The Shopify documentation on Oxygen deployments covers the full configuration API for customizing your pipeline.
Build Optimization Tips
| Optimization | Impact | Implementation |
|---|---|---|
| Tree-shaking unused code | 10-30% smaller bundles | Default with Vite (no config needed) |
| Image optimization | 40-60% smaller images | Use Shopify's Image component |
| Code splitting by route | Faster initial load | Default with React Router v7 |
| Preloading critical data | Reduced waterfall | Use loader functions |
Performance Architecture: Why Oxygen Is Fast

Oxygen's performance advantage comes from three architectural decisions that compound on each other.
Edge Rendering
Your Hydrogen storefront renders at the edge location nearest to each visitor. A customer in Tokyo gets their page rendered in Tokyo. A customer in London gets it rendered in London. No round trip to a central US server.
API Colocation
This is the feature that separates Oxygen from every other hosting option. When your Hydrogen storefront runs on Oxygen, Storefront API requests are colocated — the API server and your rendering server are on the same infrastructure. According to Shopify's engineering deep dive on high-performance Hydrogen storefronts, this colocation means data fetches that would take 50-200ms from an external host take single-digit milliseconds on Oxygen.
Streaming SSR
Hydrogen on Oxygen supports streaming server-side rendering. Instead of waiting for all data to load before sending any HTML to the browser, Oxygen streams the shell immediately and fills in dynamic content as it resolves:
- Browser receives the HTML shell instantly
- Static content (nav, footer, layout) renders first
- Dynamic content (products, prices, inventory) streams in as API calls resolve
- The page is interactive before all content has loaded
This streaming approach means your Shopify Core Web Vitals scores benefit significantly — Largest Contentful Paint (LCP) improves because the browser starts painting sooner.
Caching Strategies on Oxygen

Caching is where Oxygen performance tuning happens. Hydrogen provides built-in caching utilities that map to HTTP cache semantics.
Cache Control Helpers
Hydrogen includes three preset caching strategies:
- `CacheShort()` — 1-second stale-while-revalidate, 60-second max age. Use for data that changes frequently (cart, inventory counts).
- `CacheLong()` — 1-hour stale-while-revalidate, 1-day max age. Use for data that rarely changes (collection metadata, store policies).
- `CacheNone()` — no caching. Use for personalized or authenticated content.
Custom Cache Policies
For more control, define custom cache policies:
import {CacheCustom} from '@shopify/hydrogen';
const productCache = CacheCustom({
mode: 'public',
maxAge: 300, // 5 minutes
staleWhileRevalidate: 3600, // 1 hour
});Cache Invalidation
Oxygen respects cache headers set by your Hydrogen app. When Shopify data changes (product update, price change), you have two invalidation paths:
- Time-based — set short
maxAgevalues and let caches expire naturally - Webhook-based — listen for Shopify webhooks and purge specific cache keys
| Content Type | Recommended Cache Strategy | Rationale |
|---|---|---|
| Product listings | CacheLong | Rarely changes mid-session |
| Product detail pages | CacheShort | Inventory/pricing can change |
| Cart | CacheNone | Always personalized |
| Navigation | CacheLong | Changes with store updates only |
| Search results | CacheShort | Should reflect inventory |
When to Self-Host Hydrogen Instead of Using Oxygen
Oxygen is the default recommendation, but there are legitimate reasons to self-host your Hydrogen storefront on platforms like Vercel, Netlify, or Cloudflare Pages. Understanding the tradeoffs helps you make the right call.
Reasons to Self-Host
- Existing infrastructure — your team already operates on Vercel or AWS with established CI/CD, monitoring, and alerting
- Node.js dependencies — your project requires Node.js-specific APIs or packages that do not run on the Oxygen worker runtime
- Multi-service architecture — your storefront is part of a larger application that shares hosting infrastructure
- Custom middleware needs — you need server-side logic that exceeds Oxygen's worker constraints
Reasons to Stay on Oxygen
- API colocation — the single biggest performance advantage for Shopify data
- Zero hosting cost — included with your Shopify plan
- Simpler DevOps — no infrastructure to manage, no scaling to configure
- Preview deployments — built-in with GitHub integration
- Shopify support — one vendor for commerce and hosting
For teams building their first Hydrogen storefront, Oxygen is almost always the right starting point. The Shopify documentation on self-hosting Hydrogen covers the configuration needed if you decide to go the alternate route. You can also learn more about different frontend approaches in our headless Shopify with Webflow guide.
Common Mistakes With Oxygen Hosting

Even experienced developers hit these pitfalls when deploying to Oxygen for the first time.
Using Node.js APIs in Server Code
The most common mistake is importing Node.js modules in your server-side code. Oxygen is not Node.js — it is a worker runtime. If you see build errors mentioning fs, path, or crypto (the Node version), you are using a dependency that requires Node.js.
Fix: Check your package.json for dependencies that bundle Node.js polyfills. Use alternatives designed for edge runtimes, or move the logic to a separate API endpoint hosted on a Node.js platform.
Ignoring Environment Variable Scope
Oxygen distinguishes between public and private environment variables:
- Variables prefixed with
PUBLIC_are embedded in the client bundle (visible to browsers) - Variables without the prefix are server-only (never sent to the client)
Fix: Never put API secrets, tokens, or credentials in PUBLIC_ prefixed variables. Audit your environment variables before every production deploy.
Not Setting Up Preview Environments
Deploying directly to production without preview testing is risky. Oxygen creates preview URLs automatically for non-production branches, but you need to configure environment variables for preview environments separately.
Fix: Set up a complete set of environment variables for your preview environment. Use test API tokens and staging data sources where appropriate.
Skipping Cache Configuration
Hydrogen's default caching is conservative. Without explicit cache strategies, your storefront may make redundant API calls on every request.
Fix: Audit your loader functions and add appropriate cache strategies. Use CacheLong() for stable data and CacheShort() for volatile data. Monitor cache hit rates in your deployment analytics.
| Mistake | Symptom | Fix |
|---|---|---|
| Node.js APIs in worker code | Build failures, runtime errors | Use web-standard alternatives |
| Public secrets | Credentials in browser bundle | Remove PUBLIC_ prefix from secrets |
| No preview environments | Production-only testing | Configure preview env vars |
| Missing cache strategies | Slow page loads, high API usage | Add CacheShort/CacheLong to loaders |
| Large bundle size | Slow cold starts | Tree-shake and code-split |
Monitoring and Debugging Oxygen Deployments
Once your storefront is live, you need visibility into how it is performing.
Deployment Logs
Oxygen provides real-time logs accessible through the Shopify admin. Navigate to Hydrogen > Your Storefront > Deployments to see:
- Build logs (compilation output, errors, warnings)
- Runtime logs (request handling, errors, console output)
- Deployment status (success, failure, in-progress)
Performance Monitoring
Track these metrics for your Oxygen deployment:
- Time to First Byte (TTFB) — should be under 200ms for edge-rendered pages
- Largest Contentful Paint (LCP) — target under 2.5 seconds
- Cache hit rate — higher is better; aim for 80%+ on product pages
- Error rate — monitor for 500-level errors in deployment logs
Debugging Worker Errors
When something breaks on Oxygen, the error surface is different from Node.js:
- `ReferenceError: process is not defined` — you are using a Node.js global. Replace with worker-compatible alternatives.
- `TypeError: ... is not a function` — a dependency is using Node.js APIs. Check if an edge-compatible version exists.
- `430 Security Rejection` — Shopify's bot protection flagged your request. Ensure you are forwarding buyer IP addresses correctly.
For deeper debugging, the Weaverse guide to Shopify Hydrogen covers common edge-runtime debugging patterns and workarounds.
Oxygen vs. Alternative Hosting Platforms
If you are evaluating where to host your Hydrogen storefront, here is how Oxygen stacks up against the main alternatives in 2026.
Head-to-Head Comparison
| Feature | Oxygen | Vercel | Netlify | Cloudflare Pages |
|---|---|---|---|---|
| Shopify API colocation | Yes | No | No | No |
| Pricing | Free with Shopify plan | $20+/mo for production | $19+/mo for production | Free tier available |
| Edge locations | 285+ | 70+ | CDN only | 300+ |
| Preview deployments | Built-in | Built-in | Built-in | Built-in |
| Node.js support | No (worker only) | Yes | Yes | Limited |
| Custom domains | Yes | Yes | Yes | Yes |
| Analytics | Basic | Advanced | Basic | Basic |
| Framework lock-in | Hydrogen only | Any framework | Any framework | Any framework |
When Each Platform Wins
- Oxygen wins on cost and API colocation for pure Hydrogen projects
- Vercel wins when you need Node.js runtime or advanced analytics
- Cloudflare Pages wins for non-Hydrogen headless Shopify builds
- Netlify wins for teams already invested in the Netlify ecosystem
The right choice depends on your specific constraints. For most merchants building with Hydrogen, Oxygen delivers the best combination of performance, cost, and simplicity. If you are exploring Shopify app development alongside your storefront, consider how your hosting choice affects your overall architecture.
Getting Started: Your First Oxygen Deployment Checklist
Ready to deploy your Hydrogen storefront to Oxygen? Run through this checklist to ensure a smooth first launch.
Pre-Deployment
- Shopify store on a paid plan (Basic or above)
- Hydrogen project builds locally with npx shopify hydrogen dev
- Code pushed to a GitHub repository
- No Node.js-specific dependencies in server-side code
- Environment variables documented and ready
Deployment
- GitHub repository connected to Shopify Hydrogen channel
- Production branch selected and configured
- Environment variables set for both production and preview
- Custom domain configured (if applicable)
- SSL certificate verified
Post-Deployment
- Production URL loads correctly
- Preview deployments generate on branch pushes
- Cache strategies configured for all loader functions
- Core Web Vitals measured and within targets
- Error monitoring active
Shopify Oxygen hosting removes the infrastructure burden from headless commerce. For Hydrogen storefronts, it is the default choice for good reason — free hosting, edge performance, API colocation, and built-in CI/CD. The only scenarios where alternatives make sense are when you need Node.js runtime features or when your storefront is part of a larger non-Shopify infrastructure.
Start with Oxygen. Optimize your caching. Monitor your performance. If you hit a wall that Oxygen cannot solve, self-hosting is always available as an escape hatch. For more on the broader headless ecosystem, explore the Talk Shop community's headless commerce resources or join the conversation in our Shopify developer community.
What hosting setup are you running for your Hydrogen storefront? Drop into the community and share your experience.

About Talk Shop
The Talk Shop team — insights from our community of Shopify developers, merchants, and experts.
Related Insights
The ecommerce newsletter that's actually useful.
Daily trends, teardowns, and tactics from the top 1% of ecommerce brands. Delivered every morning.
