Skip to main content

hydrogen deploy
command

Builds and deploys your Hydrogen storefront to Oxygen. Requires an Oxygen deployment token to be set with the --token flag or an environment variable (SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN). If the storefront is linked then the Oxygen deployment token for the linked storefront will be used automatically.

The following flags are available for the hydrogen deploy command:

env: AUTH_BYPASS_TOKEN

Generate an authentication bypass token, which can be used to perform end-to-end tests against the deployment.

Anchor to --auth-bypass-token-duration <value>
--auth-bypass-token-duration <value>
string
env: AUTH_BYPASS_TOKEN_DURATION

Specify the duration (in hours) up to 12 hours for the authentication bypass token. Defaults to 2

Anchor to --build-command <value>
--build-command <value>
string

Specify a build command to run before deploying. If not specified, shopify hydrogen build will be used.

string
env: SHOPIFY_HYDROGEN_FLAG_ENTRY

Entry file for the worker. Defaults to ./server.

string

Specifies the environment to perform the operation using its handle. Fetch the handle using the env list command.

Anchor to --env-branch <value>
--env-branch <value>
string
env: SHOPIFY_HYDROGEN_ENVIRONMENT_BRANCH

Specifies the environment to perform the operation using its Git branch name.

string

Path to an environment file to override existing environment variables for the deployment.

Create a JSON file containing the deployment details in CI environments. Defaults to true, use --no-json-output to disable.

env: SHOPIFY_HYDROGEN_FLAG_LOCKFILE_CHECK

Checks that there is exactly one valid lockfile in the project. Defaults to true. Deactivate with --no-lockfile-check.

Anchor to --metadata-description <value>
--metadata-description <value>
string
env: SHOPIFY_HYDROGEN_FLAG_METADATA_DESCRIPTION

Description of the changes in the deployment. Defaults to the commit message of the latest commit if there are no uncommited changes.

Anchor to --metadata-user <value>
--metadata-user <value>
string
env: SHOPIFY_HYDROGEN_FLAG_METADATA_USER

User that initiated the deployment. Will be saved and displayed in the Shopify admin

Skip the routability verification step after deployment.

string
env: SHOPIFY_HYDROGEN_FLAG_PATH

The path to the directory of the Hydrogen storefront. Defaults to the current directory where the command is run.

Deploys to the Preview environment.

env: SHOPIFY_HYDROGEN_FLAG_FORCE

Forces a deployment to proceed if there are uncommited changes in its Git repository.

string
env: SHOPIFY_SHOP

Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).

string
env: SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN

Oxygen deployment token. Defaults to the linked storefront's token if available.

Was this section helpful?

Hydrogen deploy

shopify hydrogen deploy [flags]