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 thepnpm installcommand.
-
In Business Manager, navigate to your storefront. Click App Launcher
, then select Administration > Sites > Storefronts > New, and click your storefront. -
In the storefront detail page, click your environment, and then next to Deployments, click Manage.
-
Log in to Runtime Admin.
-
Take note of the project ID and environment ID.
-
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.
-
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 pushfrom the local storefront folder. To run the push command from another folder outside your storefront, usepnpm dlx @salesforce/storefront-next-dev pushinstead and pass in the storefront folder path with--project-directory {sfnext-project-folder}.The
.envfile in your Storefront Next project folder contains environment variables that the Storefront Next CLI uses. You can set the project ID in theSFCC_MRT_PROJECTvariable (orMRT_PROJECT), the target environment in theSFCC_MRT_ENVIRONMENTvariable (orMRT_TARGET), and the API key in theSFCC_MRT_API_KEYvariable instead of specifying them on the command line. If you specify these values in both the command line and the.envfile, the command line arguments are used. To upload only the bundle to MRT and not deploy it, don’t specify the--environmentoption and remove theSFCC_MRT_ENVIRONMENTandMRT_TARGETvariables from the.envfile. -
Verify that the bundle was deployed to the target environment. In Managed Runtime Admin, in Projects, click your project and then your environment.