Deploy SvelteKit on Temps

Install @sveltejs/adapter-node, select the Autopack (Node.js) preset (nixpacks-node) and run up: Temps runs your build script and starts node build/index.js on $PORT, so server rendering, API endpoints and form actions run in a persistent Node.js process with HTTPS.

This guide describes how Temps builds your app with the Autopack builder on v0.1.0-beta.57. The nightly channel uses a newer Autopack and newer Temps build code, so some details may differ there. v0.1.0-beta.56 also builds with Autopack, but an older version. Earlier betas and the stable channel build with Nixpacks and behave differently. To change release, see Release channels.

For an overview of self-hosting SvelteKit, including costs, see Deploy SvelteKit to your own server. Every framework and the preset it needs is listed under Supported platforms.


Quickstart

After adding the Node adapter, deploy from your project root with the Autopack (Node.js) preset (nixpacks-node), which runs your app as a Node.js server:

npx @temps-sdk/cli up --preset nixpacks-node

Or pick it under Project → Settings → Build & deploy → Build → Framework.

A SvelteKit project's svelte.config.* makes Temps offer Autopack (Node.js). If a project has a vite.config.* but no svelte.config.*, Temps detects the static Vite preset instead, which only serves the built files and can't run the SvelteKit server, so switch it to Autopack (Node.js).

With Autopack (Node.js), Temps runs your build script and starts the app with your start script. If there's no start script, it runs node build/index.js, which is where the Node adapter writes the server. A web: line in a Procfile takes priority over both. The Node adapter's server reads the PORT and HOST variables that Temps sets. The Node.js version comes from .nvmrc, .node-version or engines.node in package.json, and defaults to 24.


Node adapter setup

SvelteKit requires the Node adapter for production deployments on Temps:

npm install -D @sveltejs/adapter-node
// svelte.config.js
import adapter from '@sveltejs/adapter-node';

export default {
  kit: {
    adapter: adapter()
  }
};

What Temps handles automatically

FeatureHow Temps handles it
BuildYour build script (for example npm run build)
StartYour start script, or node build/index.js if there isn't one
HTTPSLet's Encrypt, auto-renewed
PortPORT env var injected, defaults to 3000
API endpointsFully supported via Node adapter
Form actionsFully supported
Static prerenderingPrerendered pages are served by the Node server

Environment variables

npx @temps-sdk/cli environments vars set SECRET "your-secret" -e production

Public variables use the PUBLIC_ prefix in SvelteKit. If you link a managed PostgreSQL database, Temps injects POSTGRES_URL (not DATABASE_URL); read it with $env/dynamic/private. See Deploy with a Database.


Platform behavior

These rules apply to every app deployed on Temps, regardless of framework.

The one requirement: your app must listen on the port in the PORT environment variable and bind to 0.0.0.0 — not localhost or 127.0.0.1. Temps runs your app in a container and routes traffic from the host, so an app bound to localhost only accepts connections from inside the container and will fail its health check.

Health checks

After your container starts, Temps sends HTTP GET requests to verify it is healthy before routing traffic to it.

  • Path: / (the root of your application) by default
  • Success: 2 consecutive responses with a 2xx, 3xx, 404 or 405 status code
  • Timeout: 300 seconds (5 minutes) by default for the app to become healthy; configurable from 30 to 3600 seconds under Project → Settings → Build & deploy → Deployment (Startup timeout (seconds)). A container that exits or keeps restarting fails sooner
  • Retry interval: 2 seconds between successful checks, 5 seconds after an error response or a failed connection

Connection errors and other 4xx or 5xx responses are retried until the timeout; if the app hasn't passed by then, the deployment fails. The check runs once, at deploy time. To check a different path, add a .temps.yaml to your repository root:

.temps.yaml
health:
  path: /health

Only path is used. Other health fields (status, interval, timeout, retries) are accepted but currently have no effect.

Add a dedicated /health endpoint that returns a simple 200. This avoids issues where / requires authentication or returns a redirect.

Auto-injected environment variables

Temps injects these variables into every deployment automatically:

VariableValueDescription
PORTResolved portThe port your app must listen on
HOST0.0.0.0Bind address
SENTRY_DSNAuto-generatedError tracking endpoint
TEMPS_API_URLYour Temps URLPlatform API endpoint
TEMPS_API_TOKENDeployment tokenAuthentication for Temps SDKs
OTEL_EXPORTER_OTLP_ENDPOINTYour Temps OTLP URLOpenTelemetry trace collection
OTEL_SERVICE_NAMEProject nameService identifier for traces

You do not need to configure these manually. They are available in process.env (Node.js), os.environ (Python), os.Getenv (Go), and the equivalent in other languages.

Deploying another server-rendered framework? The Remix and Next.js guides follow the same pattern.


Next Steps

Last updated

Was this page helpful?