> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sevalla.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These are the docs for Sevalla, a platform for deploying applications, databases, static sites, object storage and load balancers. The dashboard is at https://app.sevalla.com.
> Bold text in steps is an exact dashboard label.
> To act on a Sevalla account, prefer the Sevalla MCP server (https://mcp.sevalla.com/mcp, see https://docs.sevalla.com/ai-agents/overview.md), then the Sevalla CLI (https://docs.sevalla.com/developer-tools/cli.md), then the REST API (https://api-docs.sevalla.com, OpenAPI spec at https://api.sevalla.com/v3/openapi.json).
> Every page index is at https://docs.sevalla.com/llms.txt.

# Deploy JavaScript applications

> How Node.js, Bun and Deno projects run on Sevalla as applications or static sites: how Ingot builds them, the PORT variable, start commands and Node.js versions.

Sevalla runs JavaScript and TypeScript projects in two ways: as an [application](https://docs.sevalla.com/applications/overview.md), a server built from your Git repository that runs on Node.js, Bun or Deno, or as a [static site](https://docs.sevalla.com/static-sites/overview.md), the HTML, CSS and JavaScript files a build produces, served from Cloudflare's edge. The guides in this section take one framework each from an empty folder to a running deployment.

## Guides

| Guide | What you deploy | Hosted as |
| - | - | - |
| [AdonisJS](https://docs.sevalla.com/guides/javascript/adonisjs.md) | An AdonisJS 7 starter kit with Lucid, PostgreSQL and migrations in a job | Application |
| [Angular](https://docs.sevalla.com/guides/javascript/angular.md) | An Angular 22 application with server-side rendering, or an Angular app without it | Application or static site |
| [Astro](https://docs.sevalla.com/guides/javascript/astro.md) | An Astro site built to static files, or rendered on demand with the Node.js adapter | Static site or application |
| [Bun](https://docs.sevalla.com/guides/javascript/bun.md) | An HTTP server on `Bun.serve()` | Application |
| [Deno](https://docs.sevalla.com/guides/javascript/deno.md) | An HTTP server on `Deno.serve()` | Application |
| [Elysia](https://docs.sevalla.com/guides/javascript/elysia.md) | An Elysia 1.4 server on Bun | Application |
| [EmDash](https://docs.sevalla.com/guides/javascript/emdash.md) | The EmDash CMS with PostgreSQL, object storage and edge caching | Application |
| [Express](https://docs.sevalla.com/guides/javascript/express.md) | An Express 5 server | Application |
| [Fastify](https://docs.sevalla.com/guides/javascript/fastify.md) | A Fastify 5 server | Application |
| [Fresh](https://docs.sevalla.com/guides/javascript/fresh.md) | A Fresh 2 application on Deno | Application |
| [Hono](https://docs.sevalla.com/guides/javascript/hono.md) | A Hono 4 server on Node.js | Application |
| [Koa](https://docs.sevalla.com/guides/javascript/koa.md) | A Koa 3 server with @koa/router | Application |
| [Medusa](https://docs.sevalla.com/guides/javascript/medusa.md) | The Medusa 2 commerce server and admin, with PostgreSQL, Redis, a worker and product images in object storage | Application |
| [NestJS](https://docs.sevalla.com/guides/javascript/nestjs.md) | A NestJS 12 application | Application |
| [Next.js](https://docs.sevalla.com/guides/javascript/nextjs.md) | A Next.js 16 application with `next start` or a standalone server, or a static export | Application or static site |
| [Nuxt](https://docs.sevalla.com/guides/javascript/nuxt.md) | A Nuxt 4 application on Nitro's Node.js server, or a generated static site | Application or static site |
| [Payload](https://docs.sevalla.com/guides/javascript/payload.md) | The Payload 3 CMS on Next.js, with PostgreSQL and uploads in object storage | Application |
| [Playwright](https://docs.sevalla.com/guides/javascript/playwright.md) | A Node.js service that takes screenshots and PDFs with headless Chromium | Application |
| [Puppeteer](https://docs.sevalla.com/guides/javascript/puppeteer.md) | A Node.js service that takes screenshots with headless Chrome | Application |
| [Qwik](https://docs.sevalla.com/guides/javascript/qwik.md) | A Qwik City application on the Node.js server adapter | Application |
| [RedwoodJS](https://docs.sevalla.com/guides/javascript/redwoodjs.md) | A CedarJS 7 application (the maintained RedwoodJS GraphQL framework) with PostgreSQL, Prisma and migrations in a job | Application |
| [Remix](https://docs.sevalla.com/guides/javascript/remix.md) | A Remix 3 application, or a React Router application upgraded from Remix 2 | Application |
| [SolidStart](https://docs.sevalla.com/guides/javascript/solidstart.md) | A SolidStart 2 application on Nitro's Node.js server | Application |
| [Strapi](https://docs.sevalla.com/guides/javascript/strapi.md) | The Strapi 5 CMS with PostgreSQL and uploads in object storage | Application |
| [SvelteKit](https://docs.sevalla.com/guides/javascript/sveltekit.md) | A SvelteKit 3 application with the Node.js adapter | Application |
| [TanStack Start](https://docs.sevalla.com/guides/javascript/tanstack-start.md) | A TanStack Start application on Nitro's Node.js server | Application |
| [Turborepo](https://docs.sevalla.com/guides/javascript/turborepo.md) | Two applications from one Turborepo monorepo | Applications |
| [Vite](https://docs.sevalla.com/guides/javascript/vite.md) | A React or Vue single-page app built with Vite | Static site or application |
| [Docusaurus](https://docs.sevalla.com/guides/static-sites/docusaurus.md) | A Docusaurus 3 documentation site | Static site or application |
| [Eleventy](https://docs.sevalla.com/guides/static-sites/eleventy.md) | An Eleventy 3 site with a Nunjucks layout | Static site or application |
| [Gatsby](https://docs.sevalla.com/guides/static-sites/gatsby.md) | A Gatsby 5 site from the minimal TypeScript starter | Static site or application |
| [VitePress](https://docs.sevalla.com/guides/static-sites/vitepress.md) | A VitePress 1 documentation site | Static site or application |
| [BullMQ](https://docs.sevalla.com/guides/javascript/bullmq.md) | Background jobs in Redis or Valkey, run by a background worker | Any application |
| [Object storage](https://docs.sevalla.com/guides/javascript/object-storage.md) | Uploads, downloads and presigned URLs from Node.js with the AWS SDK | Any application |
| [Prisma](https://docs.sevalla.com/guides/javascript/prisma.md) | PostgreSQL from Node.js with Prisma ORM 7, and migrations in a job | Any application |
| [Redis](https://docs.sevalla.com/guides/javascript/redis.md) | A cache in a Sevalla Redis or Valkey database with ioredis | Any application |
| [Socket.IO](https://docs.sevalla.com/guides/javascript/socketio.md) | A Socket.IO 4 server over WebSockets, on one instance or several | Application |

## Application or static site

Choose by whether the project needs a server when a request arrives.

| | Application | Static site |
| - | - | - |
| What runs | A web process started by a command, such as `npm start` | No server: Cloudflare serves the files the build wrote |
| Use it for | Server-side rendering, API routes, authentication, WebSockets, background work | Sites that build to files: Astro by default, a Next.js static export, `nuxt generate`, Vite single-page apps |
| Built by | The application's [build strategy](https://docs.sevalla.com/applications/builds/overview.md), [Ingot](https://docs.sevalla.com/applications/builds/ingot.md) by default | The static site build, with the **Node version** and **Build command** you set |
| Default domain | `*.sevalla.app` | `*.sevalla.page` |
| First deployment | Starts when you click **Deploy now** | Starts as soon as you create the static site |
| Cost | Billed by process size and usage, see [Pricing](https://docs.sevalla.com/billing/pricing.md) | Free up to 100 GB of bandwidth and 600 build minutes a month |

## How Sevalla builds an application

New applications built from Git use [Ingot](https://docs.sevalla.com/applications/builds/ingot.md), Sevalla's builder. Ingot reads `package.json` and the lock file, writes a Dockerfile for the project, and Sevalla builds it:

| Step | What Ingot does |
| - | - |
| Node.js version | Uses the version the project pins (see [Pin the Node.js version](#pin-the-node-js-version)), otherwise its default line, Node.js 24. |
| Package manager | Picks pnpm for `pnpm-lock.yaml`, Bun for `bun.lock` or `bun.lockb`, Yarn for `yarn.lock` and npm for `package-lock.json`. The `packageManager` field in `package.json` wins over the lock file and sets the exact version. |
| Install | Installs from the lock file: `npm ci`, `pnpm install --frozen-lockfile`, `yarn install --frozen-lockfile` (`--immutable` on Yarn 2 and later) or `bun install --frozen-lockfile`. Dev dependencies are installed too, so build tools in `devDependencies` work. Commit the lock file: without one, versions can change between builds. |
| Build | Runs the `build` script with `NODE_ENV=production`. Without one, it runs the framework's own build command when it recognizes the framework. |
| Prune | Removes `devDependencies` after the build, so the image holds only what the server needs. It keeps them when the start command or the framework's server loads one, and the build plan's **DevDependencies** row says why. |
| Start | Uses the `start` script, or the server of the framework it detects, such as `next start` for Next.js or `node .output/server/index.mjs` for Nuxt. |

The image runs with `NODE_ENV=production`, as user `1000:1000`, from `/app`. Environment variables marked **Available during buildtime** reach the install and build steps; see [Environment variables during the build](https://docs.sevalla.com/applications/builds/ingot.md#environment-variables-during-the-build).

Before the build starts, the build log shows Ingot's build plan: each decision and the file it came from. For the [Express guide](https://docs.sevalla.com/guides/javascript/express.md), it reads:

```text Build log theme={"theme":{"light":"github-dark-default","dark":"github-dark-default"}}
╭─ ■ Node.js 24 application ───────────────────────────────────╮
│ Node.js          24              package.json engines "24.x" │
│ Package manager  npm             package-lock.json           │
│ Start            node server.js  package.json scripts.start  │
├─ Image ──────────────────────────────────────────────────────┤
│ Build            node:24-trixie                              │
│ Runtime          node:24-trixie-slim                         │
│ User             1000:1000                                   │
│ Init             tini                                        │
│ Port             $PORT, default 8080                         │
╰─────────────────────────────────────────────── Ingot v0.5.0 ─╯
```

When a project builds to static files only, such as Astro without an adapter, a Vite single-page app or a Next.js static export, Ingot builds an image that serves the files with Caddy. A [static site](#build-a-static-site) serves the same files from Cloudflare's edge, free up to the monthly allowance, so prefer it unless the files need to sit next to an application.

To change what Ingot detects, add an `ingot.json` file or set `INGOT_*` environment variables; see [Configure the build](https://docs.sevalla.com/applications/builds/ingot.md#configure-the-build). To build the image yourself, see [Build with a Dockerfile](#build-with-a-dockerfile).

## Listen on the PORT environment variable

Sevalla sets the `PORT` environment variable in the web process to the process's port, `8080` by default, and sends every request for the application's domains to that port. Sevalla's value replaces a `PORT` variable that you set yourself. Your server must:

* Listen on the port in `PORT`.
* Listen on all network interfaces (`0.0.0.0`), not on `localhost` or `127.0.0.1`.

Framework servers do both on their own, and Ingot sets the variable some of them need to listen on all interfaces, such as `HOST=0.0.0.0` for Nitro, SvelteKit's `adapter-node`, Astro's `@astrojs/node` and `react-router-serve`. A server you write yourself must pass the port in code:

| Server | Listens on `PORT` | Listens on all interfaces |
| - | - | - |
| `next start`, Nitro (Nuxt, TanStack Start), SvelteKit `adapter-node`, Astro `@astrojs/node`, `react-router-serve`, `Bun.serve()` | Yes | Yes |
| `Deno.serve()`, `deno serve` | Yes: Ingot sets `DENO_SERVE_ADDRESS` from `PORT` | Yes |
| Express `app.listen(port)`, NestJS `app.listen(port)`, Node.js `server.listen(port)` | When you pass `process.env.PORT` | Yes |
| Fastify | When you pass `process.env.PORT` | Only with `host: "0.0.0.0"` |

To use another port, update it on the application's **Networking** tab: under **Expose HTTP traffic**, click **Update port**. Sevalla then sets `PORT` to the new value. See [Networking](https://docs.sevalla.com/applications/networking.md).

## Set the start command

The web process runs the start command of the image the build produced. With Ingot, that's the `start` script in `package.json`, or the server of the framework Ingot detects; the build plan's **Start** row shows which, and where it came from. To run something else without changing the repository, open the application's **Processes** tab, open the web process's menu, click **Update process** and fill in **Custom start command**. Ingot builds the next image with that command, so the change applies at the next deployment. See [Set the start command](https://docs.sevalla.com/applications/builds/ingot.md#set-the-start-command) for every way to set it.

## Pin the Node.js version

Ingot builds on Node.js 24, its default line, unless the project asks for another version. Pin the version in `package.json`, so the build doesn't change when a new Ingot release moves its default line:

```bash theme={"theme":{"light":"github-dark-default","dark":"github-dark-default"}}
npm pkg set engines.node="24.x"
```

Ingot takes the version from the first of these that's set: the `INGOT_NODE_VERSION` environment variable, `versions.node` in `ingot.json`, `.node-version`, `.nvmrc`, `.tool-versions`, mise's configuration, then `devEngines.runtime` or `engines.node` in `package.json`. The build plan's **Node.js** row shows the version and where it came from.

* A line, such as `24`, `24.x` or `^24`, builds on that line's newest release, and every new build picks up its security fixes.
* A wider range, such as `>=20`, builds on Ingot's default line when the range allows it, otherwise on the newest maintained line it allows.
* An exact release, such as `24.11.0`, stays on that release and gets no security fixes, and the build log warns about it.

See [Set the language version](https://docs.sevalla.com/applications/builds/ingot.md#set-the-language-version) for the lines each Ingot release knows.

Static sites don't read `engines` or `.nvmrc`. Sevalla installs the **Node version** chosen in the static site's build settings, **Latest LTS** by default. See [Node versions](https://docs.sevalla.com/static-sites/build-settings.md#node-versions).

## Build a static site

A static site build installs the dependencies with the package manager your lockfile names, runs the **Build command** in the **Root directory**, and publishes the **Publish directory**, which is relative to the root directory. See [How a build runs](https://docs.sevalla.com/static-sites/build-settings.md#how-a-build-runs).

When you create a static site from a private repository, Sevalla reads `package.json` and fills in the build command and publish directory for the frameworks it recognizes, including Astro (`dist`), Next.js (`out`) and Nuxt (`.output/public`, built with `npm run generate`). See [Framework detection](https://docs.sevalla.com/static-sites/build-settings.md#framework-detection) for the full list.

## Build with a Dockerfile

Every guide that deploys an application also gives a Dockerfile for it, in its **Deploy with a Dockerfile** section, for example [Express](https://docs.sevalla.com/guides/javascript/express.md#deploy-with-a-dockerfile) or [Next.js](https://docs.sevalla.com/guides/javascript/nextjs.md#deploy-with-a-dockerfile). Switch the application to it on the **Settings** tab with **Update build strategy**. The guides' Dockerfiles do what Ingot does for you:

* **Base images.** `node:24-trixie-slim`, the Node.js line that `engines.node` pins, with `node:24-trixie` as a separate build stage when the build needs compilers. Bun and Deno guides use `oven/bun` and `denoland/deno`. A line tag, where the image publishes one, picks up security fixes at every build.
* **Install from the lock file first.** Copy `package.json` and the lock file, run `npm ci`, then copy the source, so a code change reuses the cached dependency layer.
* **Run as user `1000`.** The image's `node` user, with the application's files owned by root, so the server can't change its own code.
* **Shut down cleanly.** Run `node` with an exec-form `CMD`, so it gets `SIGTERM` when an instance stops. Node.js ignores `SIGTERM` when it runs as the container's main process and has no handler for it, so servers you write yourself, such as Express, add one that closes the server. Ingot's images run `tini` for the same reason.
* **Keep secrets out.** `.dockerignore` excludes `.env` files. Build-time environment variables reach the build as build arguments; declare the ones the build needs, such as `VITE_` or `NEXT_PUBLIC_` variables, with `ARG` in the build stage only. See [Use build arguments](https://docs.sevalla.com/applications/builds/dockerfile.md#use-build-arguments).

A background worker or job runs its **Custom start command** with `/bin/sh -l -c`. Start a long-running command with `exec`, such as `exec node worker.js`, so the worker itself gets `SIGTERM`. See [Run background jobs with BullMQ](https://docs.sevalla.com/guides/javascript/bullmq.md).

## Keep the application stateless

Each deployment starts new instances from a new image, so files written to an instance's disk are gone after the next deployment, and instances don't share memory when you run more than one. Keep state outside the process:

* Sessions and cached data in Redis: see [Use Redis from Node.js](https://docs.sevalla.com/guides/javascript/redis.md).
* Uploaded files in object storage: see [Use object storage from Node.js](https://docs.sevalla.com/guides/javascript/object-storage.md).
* Data in a [database](https://docs.sevalla.com/databases/overview.md), reached over an [internal connection](https://docs.sevalla.com/databases/connect.md).

When an application needs files on disk, attach [persistent storage](https://docs.sevalla.com/applications/disks.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.