Contents
SvelteKit does not produce one shape for deployment. It builds your app for the target set by the adapter in svelte.config.js. The default adapter-auto recognises particular cloud platforms; on ordinary hosting you choose one of two.
Choose the adapter
| Adapter | Output | Suits | Plan |
|---|---|---|---|
@sveltejs/adapter-static |
Static files in build/ |
Informational site, blog, single-page app | Any plan |
@sveltejs/adapter-node |
A Node.js server at build/index.js |
Form actions, server routes, per-visitor pages | AI and developer plans |
adapter-static on any plan
- Install the adapter:
npm i -D @sveltejs/adapter-static, and use it insvelte.config.js. - Turn on prerendering by adding
export const prerender = true;tosrc/routes/+layout.js. - Run
npm run build, and upload the contents ofbuild/topublic_html.
If your app is a single-page app, set a fallback page with fallback: "index.html" in the adapter options, and add the rewrite rule in .htaccess so you do not get a 404 on page refresh.
adapter-node on the AI and developer plans
- Install the adapter and build on your computer:
npm i -D @sveltejs/adapter-node, thennpm run build. - Upload the
build/folder withpackage.jsonand the lock file to a folder outsidepublic_html, such as/home/USER/svelteapp. - Add a startup file called
app.cjscontaining:
import("./build/index.js");
- Create the app from Setup Node.js App in cPanel: Node.js 24, Application root set to
svelteapp, and Application startup file set toapp.cjs. - Add the variables under Environment variables, most importantly:
ORIGIN=https://example.com
- Click Run NPM Install, then Restart.
ORIGIN is the one most often forgotten: without it the page refuses to submit forms. Secret variables are read from $env/dynamic/private at run time, so they go into cPanel, not into the code. General details are in the Node.js app guide and the environment variables guide.
What SvelteKit needs in production
- A recent Node.js for adapter-node: we offer 20 and 24.
- Database: MySQL/MariaDB on the account, or an external service reached over HTTPS.
- Static files: in static mode LiteSpeed serves them directly.
Limits to know
- A build on the server can stop at the memory limit, so build on your computer.
- Outgoing connections are HTTPS only, so a direct connection to an external PostgreSQL or Redis port does not work.
- Passenger may stop the app when idle, so do not rely on timers inside the server. Use Cron Jobs.
- No Docker, no root, and no serverless or edge functions.
If an error page appears after creating the app, read the log as described in Passenger app error.
On ArabyHost
Static output runs on every plan, served by LiteSpeed with a free automatic SSL certificate and daily backups. The adapter-node server runs on the AI and developer plans through Passenger with Node.js 20 or 24, with SSH, Git and deploys from GitHub. The Araby AI assistant reads the error log and explains the cause.
Prices are shown in your currency on the pricing page, and the renewal price is the price you signed up at. For comparison see Nuxt hosting and Vite hosting.
FAQ
Does SvelteKit run on shared hosting?
It does with adapter-static if every page can be prerendered, since the output is static files. Form actions, server routes and pages rendered per request need adapter-node and a plan that runs Node.js.
Why do I get Cross-site POST form submissions are forbidden?
Because the server does not know your site's address, so it rejects forms as protection against CSRF. Add the ORIGIN environment variable with your full site address including https, then restart the app.
What do I upload with adapter-node?
The build folder, package.json and the lock file. Then install the production packages on the server with the Run NPM Install button, because the build folder does not contain every package.