Skip to main content
A SvelteKit application runs on Sevalla as an application: with @sveltejs/adapter-node, Nixpacks runs vite build from your Git repository, which writes a Node.js server to build/, and the web process starts it on the port that Sevalla sets in the PORT environment variable.

Before you begin

  • A Sevalla company with a payment method, and a GitHub, GitLab or Bitbucket account for the repository. See Git providers.
  • Node.js 24 or later on your computer.

Create the project

Create a project with the Svelte CLI, choosing the SvelteKit minimal template and npm when it asks:
New projects use adapter-auto, which doesn’t build a server that Sevalla can run. Replace it with the Node.js adapter:
In SvelteKit 3, the adapter is set in vite.config.ts, where the command switches the import to @sveltejs/adapter-node:
vite.config.ts

Prepare the project for Sevalla

Add the start script and pin the Node.js version:
The server needs no other settings:
  • It takes its port from PORT, which Sevalla sets to the web process’s port (8080 by default), and listens on 0.0.0.0, all network interfaces.
  • It builds URLs from the request’s Host header and assumes HTTPS, which matches how requests reach the application through Sevalla, so form actions pass SvelteKit’s origin check without PROTOCOL_HEADER or HOST_HEADER.
Run npm run build && npm start and open http://localhost:3000 to check the production build locally. Then commit everything and push it to your Git provider:

Deploy to Sevalla

1

Create the application

In the sidebar, click Applications, then click Create > Application. Under Source, click Private repository, then choose the Git provider, the Repository and the Branch. Under Location, choose a Data center. Keep the Size at H1 or choose a larger one, then click Create application. The application opens on its Overview tab with the status Not deployed yet: creating an application doesn’t deploy it.
2

Deploy

Click the Overview tab, then click Deploy now under Recent deployments. Check the Branch and click Deploy.
3

Turn on auto-deploy

To deploy every push to the branch automatically, click the Settings tab, then click Update auto-deploy in the Auto-deploy section. Turn on Auto-deploy and click Update auto-deploy. See Deployments.

Verify the deployment

  1. On the Deployments tab, wait for the deployment’s status to change to Deployed. The application’s status next to its name changes to Running.
  2. Click the domain under the application’s name, for example storefront-x7k2m.sevalla.app. The page shows Welcome to SvelteKit.
The application header with its name, Running status, repository, branch and the domain that opens the applicationThe application header with its name, Running status, repository, branch and the domain that opens the application
If the deployment fails, open it on the Deployments tab and read its build log, then see Troubleshoot builds and deployments. If the runtime logs show that Node.js can’t find the build folder, vite.config.ts still uses adapter-auto.

Deploy changes

With Auto-deploy on, every push to the branch starts a deployment; otherwise, click Deploy now for each change. Each deployment builds the image, then replaces the web process’s instances. See Deployments.

Use environment variables

Add configuration on the application’s Environment variables tab. With adapter-node, $env/dynamic/private and $env/dynamic/public read variables when the server runs, while $env/static/* imports are replaced during vite build, so keep Available during buildtime selected for those. Variables apply at the next deployment. See Environment variables.

Add a custom domain

To serve the application from your own domain, such as shop.example.com, add the domain on the application’s Domains tab and create the DNS records that Sevalla shows. Custom domains need a web process larger than H1, so scale the web process first. See Custom domains.

Connect a database

Create a database in the same location as the application, then connect the application to it with Add environment variables to the application turned on. Sevalla adds DB_URL, DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD to the application (what each one holds), and they apply at the next deployment. Read them in server code with env.DB_URL from $env/dynamic/private.