Deploy a Hydrogen app

You can deploy a Hydrogen app to most Node.js and Worker runtimes. This guide describes how to deploy a Hydrogen app to Oxygen, Cloudflare Workers, or Docker.

Deploy to Oxygen

Oxygen is Shopify's recommended deployment platform for Hydrogen apps. This is because Oxygen is co-located with your shop's data in Shopify's data centers around the world.

Deploy to Cloudflare Workers

You can deploy your Hydrogen app to Cloudflare Workers, a serverless application platform.

  1. Create a Hydrogen app locally.

  2. Create a wrangler.toml file in the root of your project:

  3. Install Cloudflare's KV asset handler:

  4. Update the worker.js file to pass an assetHandler to handleEvent:

  5. Update package.json to include a main key:

  6. Deploy your project with Wrangler:

Deploy to Docker

You can deploy your project to any platform that supports Docker-based hosting, like Google Cloud Run, Fly.io, and Heroku.

  1. Use the Dockerfile provided by the Hydrogen starter template, or add your own to the root of your project:

  2. Build and run your app locally by running the following commands:

    The production version of your app will be running at http://localhost:8080.