Deploy a SvelteKit App
You can deploy SvelteKit as a frontend app or enable server-side rendering (SSR). With SSR enabled, the app is deployed as a backend app.
Build Process Copy link
By default, App Platform prepares the build environment by running this command:
DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \
 curl \
 {% if system_dependencies %}{{ system_dependencies | join(' ') }}{% endif %} \
 && rm -rf /var/lib/apt/lists/*system_dependencies is the list of system dependencies you specify in the dashboard. App Platform inserts them into the command during the build.
Next, App Platform installs the project dependencies. It picks the package manager (yarn, pnpm, or npm) based on your project files and runs the matching command:
yarn install
pnpm install
npm installTo build the app, App Platform runs the following command by default:
npm run buildMake sure your package.json file contains a build script.
The default build directory is /build. After the build, App Platform publishes the files from this directory.
Deploy as a Frontend App Copy link
- Add the
@sveltejs/adapter-staticadapter to your project. - Enable prerendering in your SvelteKit configuration.
Deploy with SSR Copy link
- When creating the app, enable SSR support. The app switches to backend app mode, which means:
- You select a server configuration.
- After deployment, the dashboard interface is identical to a backend app.
- You can set a start command.
- Add the
@sveltejs/adapter-nodeadapter to your project. It creates a server build in the/builddirectory. - Make sure the server listens on
0.0.0.0, not127.0.0.1. Otherwise, external connections won't work. - If your app uses forms with server handlers (form actions), set the
ORIGINenvironment variable to the full URL of your app, for examplehttps://example.hostman.dev.Â
The default start command is:
node build