Framework Frankfurt, Germany

Deploy SvelteKit on Nodion

Nodion builds SvelteKit with its Node.js buildpack and reads the adapter from package.json: with @sveltejs/adapter-node it starts your app with node build, with @sveltejs/adapter-static it serves build/ as a static site. The template default, adapter-auto, does not work on Nodion, so switch adapters first. Your app runs in Frankfurt.

Deploy to Nodion ›

from 1 EUR / month

Up to 15 € credit when signing up

Detected by
@sveltejs/kit and the adapter in package.json
Start
node build (adapter-node) or static files (adapter-static)
Node.js
22, 24 (default), 26
Region
EU Central (Frankfurt)

Deploy SvelteKit step by step

  1. Switch from adapter-auto to adapter-node Run npm i -D @sveltejs/adapter-node, remove @sveltejs/adapter-auto and use the new adapter in your config. Nodion reads the adapter from package.json, and the config decides what the build writes, so change both. In SvelteKit 3 the config lives in the sveltekit() options in vite.config.js; on SvelteKit 2 it is kit.adapter in svelte.config.js. vite.config.js (SvelteKit 3)
    import adapter from "@sveltejs/adapter-node";
    import { sveltekit } from "@sveltejs/kit/vite";
    import { defineConfig } from "vite";
    
    export default defineConfig({
      plugins: [
        sveltekit({
          adapter: adapter(),
          paths: { origin: "https://shop.example.com" },
        }),
      ],
    });
  2. Commit the lockfile, skip the start script Commit your lockfile; the build fails without one. Nodion runs your build script and starts node build, and adapter-node listens on the PORT that Nodion sets. A start script, if you add one, replaces that command.
  3. Set the public origin Nodion terminates HTTPS in front of your app, so SvelteKit cannot tell from the request which URL your visitors use, and without it form submissions are rejected as cross-site. In SvelteKit 3, set paths.origin to your public URL as in the config above; it replaces adapter-node's ORIGIN variable. On SvelteKit 2, set ORIGIN on the Environment tab instead, for example https://shop.example.com.
  4. Build-time and runtime variables Values from $env/static/private and $env/static/public are inlined during the build, so they need the Build flag on the Environment tab. $env/dynamic/private and $env/dynamic/public are read while the server runs and work with normal variables.
  5. Create the app and push In the dashboard, create an application from your GitHub, GitLab, Bitbucket or Gitea repository in the region EU Central. Every push builds a new release, and traffic moves to it once / answers with a 2xx or 3xx status. If / answers 401 or 404, add a route such as src/routes/health/+server.js that returns 200 and set /health as the health check path.

Good to know

  • Static sites with adapter-staticWith @sveltejs/adapter-static, Nodion serves build/ with a static web server and an index.html fallback. Prerender your pages with export const prerender = true in the root +layout.js. For a single-page app, turn off SSR there and set fallback: 'index.html' in the adapter options, because Nodion needs an index.html in build/. No Node.js server runs, so the smallest size is enough.
  • Keep one adapter in package.jsonNodion checks for adapter-static first, then adapter-node. If both are installed, the app is built as a static site, so remove the adapter you do not use.

What Nodion runs for you

  • Deploys without downtime Push to your branch and Nodion builds a new release. Traffic switches once the new instances answer their health check; a failed release leaves the running one in place. Apps with a local volume restart instead, because the disk belongs to one instance.
  • Databases next to the app Managed PostgreSQL, pgvector, MySQL, Valkey and ClickHouse in the same region. Attached databases arrive as DATABASE_URL, REDIS_URL or CLICKHOUSE_URL.
  • Previews per pull request Turn on previews and pull requests from your repository get their own app with its own URL and fresh, empty databases, created automatically or by hand. Forks and bot pull requests are skipped.
  • Workers, cron jobs and scaling Run workers as extra processes of the same app, schedule jobs on the Cron tab, and scale every process to up to 16 instances.
  • Release step With buildpacks, a Procfile release: line runs with every new build. Dockerfile apps, and redeploys or rollbacks to an earlier image, use a release command set on the app itself, which also takes precedence over the Procfile line. On static sites a release step runs in an image that holds only the built files.
  • Logs and metrics Build, release and runtime logs plus CPU, memory, disk and network metrics for every instance in the dashboard.
  • Domains and HTTPS A default hostname with HTTPS from the first deploy; your own domains get certificates automatically.

Further reading

SvelteKit on Nodion: questions and answers

Why does my SvelteKit app not deploy with adapter-auto?

adapter-auto only knows a fixed list of hosts, and Nodion is not on it, so the build has no output Nodion can use. Install @sveltejs/adapter-node or @sveltejs/adapter-static and use it in your config: vite.config.js in SvelteKit 3, svelte.config.js in SvelteKit 2.

Do form actions, server load functions and API routes work?

Yes, with adapter-node. Nodion runs your app as a long-running Node.js server, so +page.server.js, +server.js and form actions work as they do with node build on your machine. Set the public origin (paths.origin in SvelteKit 3, ORIGIN in SvelteKit 2) so that form actions are not rejected as cross-site.

Do I need a Dockerfile for SvelteKit?

No. With adapter-node or adapter-static, the Node.js buildpack builds the app from package.json. If your repository has a Dockerfile, the create form picks the Dockerfile strategy instead.

Where does my SvelteKit app run?

In the EU Central region in Frankfurt, Germany. Build, registry, the app and its databases, volumes, buckets, logs and metrics stay in that region, and Nodion's API and control plane are hosted in Germany. Nodion GmbH is based in Stuttgart.

Can I use SvelteKit in line with the GDPR?

Nodion provides the basis for it: Nodion GmbH is based in Stuttgart, Germany, in the Frankfurt region the app, its databases and volumes run in Germany, and you conclude the data processing agreement (DPA) under Art. 28 GDPR electronically in the dashboard. Whether your setup complies also depends on how you configure and use the app.

How much does it cost to run SvelteKit on Nodion?

An app instance starts at 1 EUR per month. The setup in the cost box costs 2 EUR per month: App 2 EUR. Prices are net and billed per second, and you pick bigger sizes or more instances whenever you need them.

Can I use my own domain for my SvelteKit app?

Yes. Every app gets a default hostname with HTTPS. Add your own domain on the app's Domains tab; the TLS certificate is issued and renewed automatically.

Give your agent a cloud.

Earn up to 15 € in credit when signing up.

Continue with GitHub

or with email

Stay in the loop.

Product news, no spam. Unsubscribe anytime.