Skip to main content
Sevalla runs JavaScript and TypeScript projects in two ways: as an application, a server built from your Git repository that runs on Node.js, Bun or Deno, or as a static site, 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

Application or static site

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

How Sevalla builds an application

New applications built from Git use Nixpacks 1.41, which reads package.json: Nixpacks sets NODE_ENV=production in the image. Environment variables marked Available during buildtime reach the build, so NIXPACKS_* variables such as NIXPACKS_BUILD_CMD and NIXPACKS_START_CMD change what it does (see Nixpacks). One case surprises framework users: when a project uses Vite with React, Vue, Svelte without SvelteKit, Preact, Lit, Solid or Qwik, Nixpacks treats it as a single-page app and serves the build output with Caddy instead of running the start script. Server-rendered frameworks built on Vite, such as TanStack Start, need the variable NIXPACKS_SPA_CADDY set to false. You can switch to Railpack (Beta), which installs the newest Node.js release that matches engines, or to a Dockerfile, on the application’s Settings tab with Update build strategy. The Deno, Puppeteer and EmDash guides use 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:
  • Read the port from process.env.PORT (Deno.env.get("PORT") in Deno).
  • Listen on all network interfaces (0.0.0.0), not on localhost or 127.0.0.1.
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.

Set the start command

The web process runs the start command of the image the build produced. With Nixpacks, that’s the start script in package.json, which every guide sets. 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. The change applies at the next deployment. See Processes.

Pin the Node.js version

Nixpacks installs Node.js 18 unless the project asks for another version, and the current releases of Astro, Next.js, Nuxt, SvelteKit, React Router, Remix, TanStack Start, Puppeteer and EmDash don’t run on Node.js 18. Pin Node.js 24 in package.json:
Nixpacks takes the version from the first of these that’s set: the NIXPACKS_NODE_VERSION environment variable, engines.node in package.json, .nvmrc, then .node-version. It only resolves the major version: for a range, it picks the newest even major version the range allows, from 14 to 24, and installs one fixed release of it. A range such as ^22.22.0 therefore gets Node.js 22.14.0, which frameworks that need 22.22 reject. Use 24.x. 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.

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. 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 for the full list.

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: When an application needs files on disk, attach persistent storage.