Deploy previews for Nuxt apps
Push a branch, get a live preview URL. PreviewDrop builds your Nuxt app, runs the Nitro Node server, and posts the link to the pull request, usually within a couple of minutes — SSR and server routes fully working.
npm run build and boots .output/server/index.mjs behind a TLS-terminated subdomain. Nitro bundles your server routes and dependencies, so SSR, API handlers and runtime config all behave exactly as they do locally.What the build needs to do
You don't write this. PreviewDrop detects Nuxtfrom your repo and builds the container for you — a Dockerfile in your repo is not used. The reference below shows the install, build and start steps a working Nuxt image needs. If detection gets one wrong, set the matching Install, Build or Start command in Project Settings. Your app must listen on $PORT.
Reference (not read by PreviewDrop)FROM node:22-slim AS build WORKDIR /app COPY package*.json ./ RUN npm ci COPY . . RUN npm run build FROM node:22-slim WORKDIR /app ENV NODE_ENV=production HOST=0.0.0.0 # Nitro bundles deps into .output — no runtime node_modules needed COPY --from=build /app/.output ./.output EXPOSE 3000 CMD ["node", ".output/server/index.mjs"]
Environment variables
Set these in the Variables tab of your PreviewDrop project. They're encrypted at rest and injected into every preview container at start.
| Variable | Example value | Note |
|---|---|---|
| PORT | 3000 | Nitro reads PORT (or NITRO_PORT) automatically. |
| HOST | 0.0.0.0 | Or NITRO_HOST. Makes the server reachable from the proxy. |
| NUXT_PUBLIC_API_BASE | https://api.example.com | NUXT_PUBLIC_* overrides runtimeConfig.public at runtime — read on container start. |
Common gotchas
Set HOST=0.0.0.0
HOST and PORT. Without HOST=0.0.0.0 it can bind to localhost inside the container and the preview will 502.Start from the whole .output directory
.output — it bundles your server dependencies, so you don’t need to copy node_modules separately. Keep .output intact and, if detection picks a different start, set the Start command to node .output/server/index.mjs.Use runtimeConfig for env, not import.meta.env
runtimeConfig.public and be overridden with NUXT_PUBLIC_* env vars — unlike Next.js, Nuxt reads these at runtime, so you can change a project variable without rebuilding.SSR is the default — keep it for previews
ssr: false or run nuxt generate for a static site, there’s no Node server — serve the static .output/public with a static file server instead.Why not Vercel or Netlify?
Preview your Nuxt app in 5 minutes
Connect a repo, push a branch, get a URL. No credit card, no trial clock.
Start free