Nuxt
Run Vue pages and server routes using Nitro’s Node output.
Deploy a Nuxt app, with its pages and server routes, as one Node server.
Build the Node server
Set the build script to nuxt build and use NITRO_PRESET=node-server during
the build. Nuxt writes everything it needs to .output. Start it with
node .output/server/index.mjs.
Set HOST=0.0.0.0 and PORT=3000. Add server/routes/health.get.ts returning
200, then set the app's health path to /health.
Anything in runtimeConfig.public is sent to the browser. Keep secrets in the
rest of runtimeConfig.
Build with a Dockerfile
This Dockerfile uses npm. For pnpm, Yarn or Bun, copy that tool's lockfile instead and change the install line.
FROM node:24.21.0-bookworm-slim@sha256:d6aa754f16b3197301076f047b5def2f02ea1dbbc2ca920407d46d7ec7f87b20 AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN NITRO_PRESET=node-server npm run build
FROM node:24.21.0-bookworm-slim@sha256:d6aa754f16b3197301076f047b5def2f02ea1dbbc2ca920407d46d7ec7f87b20
WORKDIR /app
ENV NODE_ENV=production HOST=0.0.0.0 PORT=3000
COPY --from=build --chown=10001:10001 /app/.output ./.output
USER 10001:10001
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
Deploy the app
Save the Dockerfile at the source root. In Configuration, set the port to
3000 and the health path to the route you added above. Add a .dockerignore
that excludes .env*, .git, node_modules and local build output, then deploy:
smolcloud deploy APP_ID .
Open the address it prints. You can also call a route from the CLI:
smolcloud request APP_ID /
You don't have to write a Dockerfile: see Automatic builds. To add a database or file storage, see Databases and files.
See also: Nuxt deployment.