Skip to main content

Deployment

A scaffolded storefront is a server-rendered Node application, not a static export. Deploy it the way you would any app of its framework, on any host that runs Node 20 or newer. Run the commands below from the frontend/ directory.

Build and run

StackBuildStart
Next.jsnpm run build (next build)npm run start (next start)
Nuxtnpm run build (nuxt build)run the generated .output server (node .output/server/index.mjs)
Vuenpm run build (client and server bundles)npm run start (node server.js)

Set PORT in the environment to control the listening port. The Vue and Nuxt servers read it directly; for Next.js use PORT or the -p flag.

Environment variables

Set the same variables as in local development, with production values, in your host's environment or secret store. The GraphQL endpoint and API key are server-side only: the browser talks to the /api/graphql proxy, so the key never reaches the client. Keep it secret.

At minimum, set the GraphQL endpoint, the API key, the base category, the default language, the portal mode and the site URL. See Accelerator for the full list and the per-stack variable names, and the committed environment example in your boilerplate.

On-demand revalidation

The Next.js and Nuxt boilerplates cache anonymous pages and expose POST /api/revalidate, gated by the REVALIDATE_SECRET you set. Point a backend webhook at it so a content or catalog change refreshes the affected pages without a full rebuild. See Routing.

CMS

If you scaffolded with a CMS (Next.js only), set CMS_PROVIDER and the CMS backend URL in production, and host the CMS itself separately. See CMS integration.

See also