Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Docs
  2. Apps
  3. Node apps

Node apps

SPA, static and SSR frontends built on every deploy.

Apps

Node apps build and serve modern front-ends with the same lifecycle as Laravel apps: releases, rollback, webhook, SSL, basic auth, redirects, proxies and the deploy audit.

bash
# Vite SPA: build, serve dist/ with an index.html fallback
cipi app create --user=web --domain=web.example.com \
    --repository=git@github.com:you/web.git --node=spa --framework=vite
# Pre-rendered site (Astro, Nuxt generate, Next export)
cipi app create --user=docs --domain=docs.example.com \
    --repository=git@github.com:you/docs.git --node=static --output=dist
# Node server with blue/green deploys
cipi app create --user=shop --domain=shop.example.com \
    --repository=git@github.com:you/shop.git --node=ssr --framework=next --node-version=24

Modes#

ModeNginxUse for
spaServes the build; unknown paths fall back to /index.htmlClient-side routed apps
staticServes the build; real 404s via /404.htmlPre-rendered sites
ssrProxies to a Node process on localhost, WebSockets includedNext.js, Nuxt, SvelteKit, Remix, Astro SSR

Hashed assets (assets/, _astro/, _nuxt/, _app/immutable/) are cached as immutable; HTML is never cached.

Options#

FlagMeaning
--frameworkPreset: vite (spa), next, nuxt, sveltekit, astro, remix (ssr). Explicit flags win
--node-versionLTS major: 22 or 24 (default: the server default)
--buildBuild command (default npm run build)
--startSSR start command, a Node runner plus arguments, e.g. node build
--outputBuild folder for spa/static; the deploy fails if it has no index.html
--health-pathSSR path that must answer below 500 before a release takes traffic (default /)

The build installs from your lockfile (npm ci, pnpm install --frozen-lockfile, yarn install --immutable, bun install --frozen-lockfile) with NODE_ENV=production. shared/.env is read at build time and by SSR servers at runtime; edit it with cipi app env.

Zero-downtime SSR: blue/green#

Step 1 of 4Start new release

Each Node app has two slots (blue and green). The new release starts on the slot that isn't serving traffic.

Two Supervisor programs (shop-node-blue, shop-node-green) each own a local port. If the new release crashes or never answers, it is stopped, the old slot keeps serving and the deploy fails before anything goes live. Rollback and cipi node restart switch the same way.

The switch runs as root through a narrow rule: ports, start command, Node version and health path come from a root-owned file, not from the app. .env is read as data, never executed; HOST is forced to 127.0.0.1 and the start command runs without a shell.

Manage#

bash
cipi node status shop                 # mode, commands, slots
cipi node restart shop                # zero downtime
cipi node logs shop --lines=100
cipi app edit shop --start="node .output/server/index.mjs" --health-path=/health
cipi app edit web --node=static --output=dist

The same settings can live in your repository in the node: section of cipi.yml. Push-to-deploy works without a Laravel agent: Cipi ships a hardened webhook receiver that verifies GitHub/Bitbucket signatures and GitLab/Azure tokens.

Node apps get no database by default; add one with cipi db. cipi sync and cipi app clone do not handle Node apps yet.

Common problems#

ProblemFix
Deploy fails: no index.html--output points at the wrong build folder
SSR release never goes liveIt must answer the health path within 60 s; check --start and the logs

Questions#

QuestionAnswer
Which frameworks?Vite SPAs, static builds, Next, Nuxt, SvelteKit, Astro, Remix.
With a Laravel API?API + Next.js/Nuxt guide.