Deploy

Project settings

How your app's framework is detected, the commands and limits you can change, and the variables every app gets.

Detection

When you import a repository, the panel reads its package.json, its lockfile and its Node version files, and works out:

Worked out from
Framework The dependencies: Next.js, Nuxt, Astro (server or static), Remix, React Router, Vite, Create React App, a Node server like Express, Fastify or Hono, or plain HTML
Package manager The lockfile (pnpm-lock.yaml, yarn.lock, bun.lock, package-lock.json) or the packageManager field
Build command The build script
How it runs A Node server with a start command, or static files from an output folder
Node version .nvmrc, .node-version or engines.node; otherwise the current LTS

Every value can be changed on the project's Settings page. Empty fields use what was detected.

Settings

  • Source: the repository, and the branch that deploys on push. A root folder, for a project inside a monorepo, is set when you import it.
  • Build:
    • The install command. Empty: your package manager, with the lockfile.
    • The build command. Empty: no build step.
    • The Node version: an exact version, installed on the server if needed.
  • Run:
    • Node.js server: the start command, which begins with node, npm or npx. The health check path, which must answer before traffic switches to a new build. Writable folders inside the project, comma-separated; data/ is always writable.
    • Static files: the output folder the build produces, like dist. And whether it's a single-page app, which serves index.html for unknown paths.
  • Resources: the memory limit, from 128 to 16384 MB. The app restarts if it goes over, so one app can't freeze the server.

Save keeps the settings for the next deploy; Save and redeploy builds with them right away.

Variables every app gets

Variable Value
DATA_DIR /srv/apps/<app>/data: the one folder that survives deploys, for databases and uploads
PORT The live color's port
HOST 127.0.0.1: apps listen on the server only, behind Caddy
DATABASE_URL, MONGODB_URI, REDIS_URL When you add a database

Everything outside DATA_DIR and the writable folders is read-only while the app runs. Files an app writes next to its code would be gone after the next deploy anyway, since each deploy builds into a fresh folder.

Delete a project

At the bottom of Settings, Delete project asks you to type the project's name. It stops the app and removes its Linux user, files, unit, Caddy site and databases. Its data/ folder and final database dumps are kept in /var/lib/layer-agent/archive/, unless you choose to delete them too.