Quickstart cipi.yml Web panel API MCP Ecosystem Guides Docs GitHub Telegram channel
  1. Home
  2. Guides
  3. Deploy Next.js, Nuxt, SvelteKit or Astro on your own VPS with zero downtime
Get started

Deploy Next.js, Nuxt, SvelteKit or Astro on your own VPS with zero downtime

Host a Node front end next to your PHP apps — a Vite SPA, a static Astro or Nuxt site, or a Next.js, Nuxt, SvelteKit, Astro or Remix server — built on every push, switched blue/green with a health check, with HTTPS, its .env, logs and previews of any branch.

By Updated 5 min read

A Node front end doesn't need a platform of its own. On a Cipi server it is one more app, next to your Laravel and WordPress sites: built from Git on every push, served by Nginx with HTTPS, and — for a Node server — switched blue/green, so a release only gets traffic once it answers.

What you deployModeServed by
A Vite SPA (React, Vue, Svelte)spaNginx, from the build; unknown paths fall back to /index.html
A pre-rendered site (Astro, Nuxt generate, Next export)staticNginx, from the build; real 404s from /404.html
A Node server (Next.js, Nuxt, SvelteKit, Astro SSR, Remix)ssrYour Node process on localhost, behind Nginx, blue/green

Before you start#

You needWhy
A server with Cipi (install)Ubuntu 24.04 or 26.04. Builds want memory: 2 GB of RAM for a Next.js app, more with several
The repository on GitHub, GitLab, Bitbucket, Gitea or Azure DevOpsEvery deploy is a build of it
A lockfile in the repositorypackage-lock.json, pnpm-lock.yaml, yarn.lock or bun.lockb: the install is frozen to it
A domainAn A record to the server
For SSR: the framework's Node serverNext.js as is; Nuxt as is (Nitro's node preset); SvelteKit with @sveltejs/adapter-node; Astro with @astrojs/node in standalone mode

1. Create the app#

The --framework preset fills the mode, the build and the start command:

bash
# Next.js, on Node 24
sudo cipi app create --user=shop --domain=shop.example.com \
    --repository=git@github.com:acme/shop.git --node=ssr --framework=next --node-version=24

# Nuxt (server), SvelteKit, Astro SSR, Remix: the same with --framework=nuxt|sveltekit|astro|remix

# A Vite SPA
sudo cipi app create --user=web --domain=app.example.com \
    --repository=git@github.com:acme/web.git --node=spa --framework=vite

# A static Astro or Nuxt-generate site
sudo cipi app create --user=docs --domain=docs.example.com \
    --repository=git@github.com:acme/docs.git --node=static --output=dist
PresetBuildStart
nextnpm run buildnpx next start -H 127.0.0.1
nuxtnpm run buildnode .output/server/index.mjs
sveltekitnpm run buildnode build
astronpm run buildnode ./dist/server/entry.mjs
remixnpm run buildnpm run start
vitenpm run build— (Nginx serves dist/)

Anything else is a flag away: --build=, --start=, --output=, --health-path= (the path that must answer below 500 before a release takes traffic, / by default), --db= for a database of the app's own. In the web panel: Apps → New app → Node, with the same presets.

With a provider token saved (Git providers), the deploy key and the webhook are already on the repository. Otherwise add the deploy key — sudo cipi deploy shop --key — as a read-only key.

2. The environment#

bash
sudo cipi app env shop

~/shared/.env is read at build time — so NEXT_PUBLIC_*, NUXT_PUBLIC_* and VITE_* end up in the bundle — and by the server at runtime. Put your API's address, keys and feature flags there:

bash
sudo cipi app env shop --set=NEXT_PUBLIC_API_URL=https://api.example.com
sudo cipi app env shop --set=SESSION_SECRET=…

PORT and HOST are Cipi's: each slot gets its own port on 127.0.0.1 (NITRO_PORT and NITRO_HOST for Nuxt), and a value in the .env can't move the server off localhost. A change to a runtime variable takes effect with a restart; one that ends up in the bundle needs a deploy.

3. Deploy#

bash
sudo cipi deploy shop
Step 1 of 6Clone

The branch's commit, in a folder of its own.

For a SPA or a static site the last three steps are one: the build folder must have an index.html, then current moves. A rollback is the same switch backwards:

bash
sudo cipi deploy shop --rollback

Then HTTPS, once the domain points at the server:

bash
sudo cipi ssl install shop

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

4. Push to deploy#

A push to the app's branch deploys it. Nothing is added to the project: Cipi's own receiver checks the provider's signature.

ServerThe webhook
With its own domainhttps://webhooks.example.com/shop
Withouthttps://shop.example.com/cipi/webhook, once the app has HTTPS
bash
sudo cipi app webhook show shop          # the URL, the secret, whether a push deploys
sudo cipi app webhook auto shop off      # deploy from CI instead

Full details: push-to-deploy.

5. Logs, restarts, Node versions#

bash
sudo cipi node status shop               # mode, commands, which slot serves
sudo cipi node logs shop --lines=100     # the serving slot's output
sudo cipi app logs shop --type=node      # both slots, followed
sudo cipi node restart shop              # zero downtime: the idle slot first
sudo cipi app run shop npm ls --depth=0  # a command in the live release, as the app
NodeCommand
Install another majorsudo cipi node install 24
Move one appsudo cipi app edit shop --node-version=24, then deploy
Latest patch, SSR restarted without downtimesudo cipi node upgrade 24 --restart
What runs wheresudo cipi node list

Builds come from the official Node releases, checked against their published checksums. The settings can also live in the repository, in the node: section of cipi.yml.

6. A preview of any branch#

With the server's own domain set:

bash
sudo cipi preview create shop feature/checkout-v2

The branch is built and served on https://shop-feature-checkout-v2-k3m9q.example.com, with its own .env (copied from the app's), its own slots and its own certificate. Every push to the branch deploys it; deleting the branch removes it. Preview branches has the rest — including the panel and opening one per pull request from CI.

7. Next to a Laravel API#

The usual pair — a Laravel API and a Next.js or Nuxt front end — is two apps on the same server: api.example.com and example.com, or one domain with the API behind a proxy route. Server-side calls from the Node app to the API stay on the machine. Step by step: Laravel API + Next.js or Nuxt on one server.

Troubleshooting#

ProblemFix
no index.html after the build--output points at the wrong folder: sudo cipi app edit web --output=build
An SSR release never goes liveIt must answer the health path within 60 seconds: check --start (sudo cipi node status shop) and sudo cipi node logs shop. A server that listens on a fixed port, not PORT, never answers
Astro or SvelteKit starts but answers nothingThe Node adapter is missing: @astrojs/node in standalone mode, @sveltejs/adapter-node
NEXT_PUBLIC_… is empty in the browserIt was set after the build: deploy again
The build is killed, or slow on some daysMemory: add swap or RAM, or give the build more time — sudo cipi app deploy-config shop --build-timeout=2700 (slow builds)
The install fails on the lockfileThe lockfile and package.json disagree: run the install locally, commit the lockfile
A push doesn't deploysudo cipi app webhook show shop says what the provider must call and what is missing

The reference page, with every option: Node apps.

Questions

Is this a Vercel or Netlify alternative?

For apps that run on one Node server, yes: build on push, HTTPS, previews of any branch, rollback — on a VPS with a fixed price, next to your PHP apps. What it doesn't have is an edge network: put Cloudflare in front for that.

Which frameworks?

Vite SPAs (React, Vue, Svelte), static builds (Astro, Nuxt generate, Next export, Eleventy), and Node servers: Next.js, Nuxt, SvelteKit (adapter-node), Astro (the Node adapter, standalone) and Remix. Anything with a build command and a start command works with --build and --start.

Is it really zero downtime for a Node server?

Yes. Each app has two slots. A deploy starts the new release on the idle one, waits until it answers its health path, switches Nginx, then lets the old one finish its requests. A release that never answers never gets traffic.

Which package manager?

npm, pnpm, Yarn or Bun — whichever lockfile the repository has; the install is frozen to it.

Where do environment variables go?

In ~/shared/.env, edited with sudo cipi app env shop. It is read at build time (for NEXT_PUBLIC_*, VITE_*) and by the server at runtime. PORT and HOST are set by Cipi.

Does it need a database?

No. Add one with --db when the server reads it directly (Prisma, Drizzle); a front end that calls a Laravel API needs none.

Can it share a domain with a Laravel API?

Yes: one app per domain and a proxy, or two domains. Laravel API + Next.js or Nuxt walks through both.

Try it on your own server

Free and open source. One command on a fresh Ubuntu 24.04 or 26.04 VPS.

wget -O - https://cipi.sh/setup.sh | bash
Read the quickstart