Skip to content

Node

The Node adapter is the fallback for any host Velocity doesn’t recognize, including Docker and a VPS. It runs a standalone server that serves prerendered pages and handles Astro Actions.

Terminal window
pnpm build
HOST=0.0.0.0 PORT=4321 node dist/server/entry.mjs

The server doesn’t load .env by itself. To use it for runtime variables such as CONTACT_FORM_ENDPOINT, pass it to Node, or set the variables in the server’s environment:

Terminal window
node --env-file=.env dist/server/entry.mjs

Without the form endpoints, the server discards submissions and logs a warning. See Forms & Actions.

Force the target if your build environment sets VERCEL, NETLIFY or similar:

Terminal window
DEPLOY_TARGET=node pnpm build
FROM node:24-slim AS build
WORKDIR /app
RUN corepack enable
COPY . .
RUN pnpm install --frozen-lockfile
RUN DEPLOY_TARGET=node pnpm build
FROM node:24-slim
WORKDIR /app
COPY --from=build /app/dist ./dist
COPY --from=build /app/node_modules ./node_modules
ENV HOST=0.0.0.0 PORT=4321
EXPOSE 4321
CMD ["node", "dist/server/entry.mjs"]

Actions need a server, so a pure static host can serve your pages but not your forms. To use one, deploy dist/client/ and point the forms at an external endpoint with the action prop.

Route caching uses an in-memory cache, which resets on restart and isn’t shared between instances. Velocity’s security headers ship in vercel.json and netlify.toml, so set them in your reverse proxy here.