PreviewDrop for Nuxt
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 in under 60 seconds — SSR and server routes fully working.
TL;DR
Add the Dockerfile, connect your repo, push. PreviewDrop runs
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.Dockerfile
Drop this at the root of your repo. PreviewDrop picks it up on the next push and builds it into a container behind a TLS-terminated subdomain.
DockerfileFROM 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
Nitro reads
HOST and PORT. Without HOST=0.0.0.0 it can bind to localhost inside the container and the preview will 502.Copy the whole .output directory
The Nitro build is fully self-contained in
.output — it bundles your server dependencies, so you don’t need to copy node_modules into the runtime stage. Copy .output and run node .output/server/index.mjs.Use runtimeConfig for env, not import.meta.env
Public values exposed to the client should live under
runtimeConfig.public and be overridden with NUXT_PUBLIC_* env vars — unlike Next.js, Nuxt reads these at runtime, so you can change them per preview without rebuilding.SSR is the default — keep it for previews
The Node server path assumes SSR (the default). If you set
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?
Nuxt deploys fine to Vercel and Netlify — PreviewDrop is the option when you’d rather self-host the Nitro Node server, want password-protected client previews, prefer flat per-workspace pricing, or run Nuxt next to a backend API that also needs branch previews. You bring a Dockerfile; we run the real Node process behind HTTPS.
Preview your Nuxt app in 5 minutes
Connect a repo, push a branch, get a URL. No credit card, no trial clock.
Start free