Deployment
Nuxt supports two deployment modes. Choose the one that fits your infrastructure.
nitro.prerender.routes). SSG produces static files that can be served via CDN without a Node.js server, which is the simplest and most cost-effective setup for a PWA.| Mode | Command | Output | Requires Node.js |
|---|---|---|---|
| SSR | npm run build | .output/ | Yes |
| SSG | npm run generate | .output/public/ | No |
Mode 1: SSR (Server-Side Rendering)
Pages are rendered on the server at request time. Requires a Node.js runtime on the server.
Build the project
npm run build
Output is placed in the .output/ folder.
Start the server
node .output/server/index.mjs
The app will be available at http://localhost:3000.
Deploy the output
Upload the entire .output/ folder to your server and run the start command above. Options:
Node.js Server
Run directly with Node.js or use a process manager like PM2 for production.
Docker
Containerize the .output/ folder for consistent deployments across environments.
Vercel / Render
Platforms with native Nuxt SSR support — connect your repo and deploy automatically.
Mode 2: SSG (Static Site Generation)
Pages are pre-rendered at build time into static HTML files. No Node.js required at runtime — deploy anywhere.
Generate the project
npm run generate
Output is placed in .output/public/ as static files.
Deploy the static files
Upload the contents of .output/public/ to your hosting. Options:
Static File Server
Serve with nginx, Apache, or any static file server.
CDN
Upload to any CDN — AWS S3 + CloudFront, Cloudflare Pages, etc.
Netlify / GitHub Pages
Connect your repo and set the output directory to .output/public/.
Platform Build Settings
When deploying via Vercel, Netlify, or similar platforms:
| Setting | SSR | SSG |
|---|---|---|
| Build command | npm run build | npm run generate |
| Output directory | .output | .output/public |