Node.js
A Node application is a first-class site type: deployed from Git, health-checked before it takes traffic, and run in its own sandboxed systemd unit on a private port behind nginx.
Creating an application
klyrn site create app.example.com --type node \
--runtime 22 \
--git https://github.com/you/app --branch main \
--start "npm start" --build "npm run build"
--start and --build are detected from the repository when you
leave them out. --runtime takes a major version or a full version; the latest
LTS is used if you do not say. Runtimes are fetched on demand and verified against
nodejs.org's published SHA-256 list.
klyrn node # installed and available runtimes
Deploying
klyrn app deploy app.example.com --git https://github.com/you/app --branch main
klyrn app rollback app.example.com
klyrn app show app.example.com
A deploy is one job with the same shape every time:
- CloneAs the account user, over HTTPS. Root never runs Git against a customer's repository.
- Install and build
npm ci, then the build command. - Health-checkThe new release is started and probed before it takes any traffic.
- Switchnginx is pointed at the new release. The previous one stays on disk.
That last line is what makes klyrn app rollback instant: the release it goes
back to is already unpacked, already installed and already built.
Environment and settings
klyrn app env app.example.com # show
klyrn app env app.example.com DATABASE_URL=postgres://… STRIPE_KEY=sk_live_…
klyrn app env app.example.com --unset STRIPE_KEY
klyrn app set app.example.com --start "node server.js"
klyrn app set app.example.com --build - # clear the build command
klyrn app set app.example.com --health /healthz
klyrn app set app.example.com --memory 512
Environment variables are the customer's secrets: they are encrypted at rest and they go into the per-site backup manifest, which is itself encrypted, rather than into anything in the clear.
How it runs
klyrn app start app.example.com
klyrn app stop app.example.com
klyrn app restart app.example.com
klyrn app logs app.example.com --lines 200
Each application is one systemd unit, sandboxed, with a memory ceiling, listening on a
private port on the loopback interface with nginx and TLS in front of it. The health
engine's apps check runs every 30 seconds and has exactly one repair:
restart units that are in the failed state. It does not restart a unit that is merely
slow, and it stops after three attempts in thirty minutes.
Rolling KLYRN back with klyrn install --rollback removes the per-application
units it created, so a rolled-back server is not left starting services for sites that no
longer exist.