Deploy Storefront Next to Managed Runtime (MRT)

To redeploy a storefront that was created in Business Manager after initial deployment, use the Storefront Next CLI and the autocreated MRT project and environment.

  • Node Package Manager (pnpm) version 10.28.0 or later. See Installation on the pnpm site.
  • Node.js version 24.13.0 or later. See Download Node.js on the Node.js site.
  • To install Storefront Next dependencies specified in package.json, run the pnpm install command.
  1. In Business Manager, navigate to your storefront. Click App Launcher App Launcher, then select Administration > Sites > Storefronts > New, and click your storefront.

  2. In the storefront detail page, click your environment, and then next to Deployments, click Manage.

  3. Log in to Runtime Admin.

  4. Take note of the project ID and environment ID.

  5. To authenticate the CLI to Managed Runtime, use an API key. Get the Managed Runtime API key in Managed Runtime Admin. In Account Settings, under Personal API Key, do one of these steps.

    a. If you haven’t yet created an API key, click Generate.

    b. If you already have an API key, the value is partially masked. Click Reset, then click Reset my API Key when asked for confirmation.

  6. From your local storefront folder, use this command to create a bundle and deploy it to your Managed Runtime environment. Replace the placeholders with the MRT project ID, target environment, and the API key you got earlier.

    Always run pnpm sfnext push from the local storefront folder. To run the push command from another folder outside your storefront, use pnpm dlx @salesforce/storefront-next-dev push instead and pass in the storefront folder path with --project-directory {sfnext-project-folder}.

    The .env file in your Storefront Next project folder contains environment variables that the Storefront Next CLI uses. You can set the project ID in the SFCC_MRT_PROJECT variable (or MRT_PROJECT), the target environment in the SFCC_MRT_ENVIRONMENT variable (or MRT_TARGET), and the API key in the SFCC_MRT_API_KEY variable instead of specifying them on the command line. If you specify these values in both the command line and the .env file, the command line arguments are used. To upload only the bundle to MRT and not deploy it, don’t specify the --environment option and remove the SFCC_MRT_ENVIRONMENT and MRT_TARGET variables from the .env file.

  7. Verify that the bundle was deployed to the target environment. In Managed Runtime Admin, in Projects, click your project and then your environment.