Skip to main content
Open console

Node.js

A Node application serving its own HTTP, such as Next.js, Nuxt, Express or anything else that listens on a port

2 min read

A Node application serving its own HTTP — Next.js, Nuxt, Express or anything else that listens on a port. It is the web server as well as the application, so it replaces PHP-FPM and nginx. The platform's proxy in front of it terminates TLS, routes the hostname and compresses responses.

The container runs as vallic with the release at /var/www/html/current (WEB_ROOT), read-only, and the release's own node_modules/.bin on PATH. The release keeps node_modules, so the build's last step prunes what production does not need.

To run the same project on Bun instead, write bun: under runtime in place of node:. To run one beside a backend in another language, see Multi app (beta).

A Next.js project

vallic.yaml at the root of the repository:

version: 1
type: nodejs

runtime:
  node: '24'

build:
  steps:
    - name: Dependencies
      run: npm ci
    - name: Build
      run: npm run build
    - name: Production dependencies only
      run: npm prune --omit=dev
  cache:
    - .next/cache

start: npm start
port: 3000

health:
  path: /
  timeout: 30

Only .next/cache is carried between builds, which lets Next.js skip what has not changed. Caching node_modules gains nothing: npm ci deletes it before it installs. The platform keeps npm's own downloads for each project, so the install takes packages from the machine rather than from the registry.

npm start is next start, which serves the .next directory the build produced and listens on PORT. Both start and port are the defaults, so they can be left out. The platform sets HOSTNAME to 0.0.0.0, which Next.js binds, and NODE_ENV is production.

Write uploads and anything else created at runtime under /mnt/files (VALLIC_PUBLIC_DIR, VALLIC_PRIVATE_DIR), which outlives the release. Set environment variables, such as a database URL or an API key, on the environment in the console. They reach the process as ordinary environment variables, not as an .env file in the checkout.

The npm in the image is 12, whichever Node line runs: a dependency's install scripts run only where package.json allows them, and git or URL dependencies only where .npmrc does. A build that needs npm 11 installs with npx -y npm@11 ci. See npm 12.

Versions

Version Status
26.13 Supported
26.11 Supported, and the default
26.12 Supported
24.21 Supported
24.22 Supported
22.23 Supported

Pin the version, not the build: name 26.11 and the platform matches it to the current build, so a security rebuild reaches you without anybody editing a repository.

What you can change

In vallic.yaml — what each one does is on Service settings:

services:
  - nodejs:
      version: '26.11'
      environment:
        NODE_OPTIONS: …

Anything not on this list refuses the deploy, naming the variable — rather than being accepted and quietly ignored.

Need a hand?

Open a ticket from Support in the console. We answer on the ticket.

Open the console How support works