Front-end and static sites
How to deploy a SvelteKit or Svelte app online
In short
A plain Svelte app built with Vite compiles into a folder of static files, so you can host it as a static site. A SvelteKit app needs an adapter: the setting that tells the build what to produce, either prerendered pages (adapter-static) or a Node app that answers requests (adapter-node). Adapters written for one specific host, such as vercel, netlify or cloudflare, will not build when you self-host SvelteKit, so swap them for node or static. To deploy either kind of app, upload the code to Netrun as an archive or from a GitHub repository: the platform installs the dependencies, runs the build and gives you a public HTTPS link.
Normally, to deploy a Svelte app you rent a server, install Node.js on it, build the project, either serve the finished files or keep a process running, put a proxy in front of it and get a certificate. With SvelteKit there is one more question, and it is the one people trip over most: which adapter to pick so that the build even finishes.
Netrun takes that part away: you upload the code, the platform sees that this is a Node.js project, installs the dependencies, builds it and gives you a public HTTPS link. One decision is left to you, and only for SvelteKit: whether to build into prerendered pages or into an app that answers requests. Both cases are below, along with plain Svelte without Kit.
Work out whether you have plain Svelte or SvelteKit#
Open package.json. If it lists only svelte and vite and the build drops the result into a dist folder, this is a plain Svelte app and the output is a static site: pages, scripts and styles. If @sveltejs/kit is in the dependencies, you have SvelteKit, and it has to be told what to build into. Exactly one step differs between the two, everything else is the same.
Pick an adapter for SvelteKit#
An adapter is a line of configuration in svelte.config that tells the build what to produce: a folder of prerendered pages, or a Node app that answers requests. If there is no server side, meaning no data loaded on the server and no server-handled forms, use adapter-static and turn prerendering on in the root layout file. If there is a server side, use adapter-node: it writes a ready server into the build folder, started with "node build", so add that as the start script in package.json.
Replace an adapter written for another host#
A fresh SvelteKit project ships with adapter-auto, which guesses the host from its environment and stops the build anywhere it does not recognize, saying it could not detect a supported production environment. Adapters made for one specific service, such as vercel, netlify or cloudflare, will not build either, because they produce output for that service, not for an ordinary server. Swap them for node or static: those are the standard SvelteKit adapters and they run on any ordinary server, ours included.
Let the platform choose the port#
The app has to listen on the port the platform passes in the PORT environment variable, and on 0.0.0.0 rather than localhost. The SvelteKit node adapter already does this, so you do not set a port in the code, you only make sure no fixed number is baked into the start script. A hard-coded port is the number one reason the build succeeds but the link opens blank. With the static adapter the port does not matter at all, since plain files are served.
Move keys into secrets#
Do not keep tokens, third-party keys or a database connection string in the code or in a .env file inside the archive. Netrun asks for those values during project setup and passes them in as environment variables, stored encrypted. In SvelteKit server-side values are read from the environment, while anything the browser needs has to carry the PUBLIC_ prefix, otherwise it never reaches the client code.
Upload the code and take the link#
Bring the project in as a ZIP archive or import it from GitHub, private repositories included. Leave out node_modules, dist, build and .svelte-kit: we install the dependencies and run the build on our side, so the archive stays small. Netrun builds the project and gives you a public HTTPS link, and logs and build status are visible in your dashboard in real time, so a build that stumbles is obvious straight away.
The result: your Svelte or SvelteKit app is online at an HTTPS address, with no rented server, no proxy config and no manual certificate. The free plan gives you one project, and a site on it sleeps while nobody uses it and wakes up on its own when someone opens the link, so only the first visit after a pause is a little slower. If the site has to be ready at all times and you want your own domain, the Pro plan fits; current prices and limits are shown in your dashboard. Try Netrun.
Common questions
How is deploying SvelteKit different from deploying plain Svelte?
A plain Svelte app built with Vite compiles into a folder of files that only has to be served as a static site. SvelteKit can do both: it can build into prerendered pages, or into a Node app with a server side. Which one you get is decided by the adapter set in the project config.
Which SvelteKit adapter should I choose?
If the whole site can be rendered ahead of time and nothing has to be computed per request, use adapter-static: you get prerendered pages, which load fastest. If you have server routes, form actions handled on the server, or data the browser must not see, use adapter-node. Both run on an ordinary server and on Netrun.
Why does my build fail on adapter-auto?
That adapter detects the host from its environment and only knows a handful of specific services. On any other server it finds no familiar markers and stops the build, saying it could not detect a supported production environment. The fix is to replace it with adapter-node or adapter-static in the project config.
Why do inner pages return 404 on refresh with the static adapter?
A static build only writes the pages SvelteKit managed to render ahead of time. If some routes only appear in the browser, enable the fallback page in the static adapter options: any address then returns it and the app resolves the route itself. The other option is to prerender every page.
Do I need to install Node.js myself to self-host SvelteKit?
No. With the static adapter the output is plain files served by a web server. With the node adapter the server side does run on Node.js, but you do not install or configure it: Netrun recognizes the project from package.json and brings everything up itself.
Can I deploy SvelteKit together with a database?
Yes. You can use an external database and pass the connection string in as a secret, or run one next to the app with your own docker-compose, where a single project may hold up to five linked services. In that case the data lives in the volume declared in your file and survives a code update.
What about React, Vue, Next.js, Nuxt, Svelte or Astro?
Yes, all of them work. Upload the source code with your package.json — you do not need to build the project yourself or include the built output, the build happens on our side. If your framework can produce both static pages and a server build, either works: in server mode the app should listen on the port from the environment variable. One important detail: values baked into the built front-end are visible to any visitor, so keep real keys on the server side.
How is Netrun different from Vercel and Render?
Vercel is built for frontends and serverless functions — not every backend or Telegram bot will run there. Render is closer in purpose, but it is a foreign service that needs a foreign card. Netrun runs any code — a website, an API or a bot — accepts payment by Russian card and via SBP and offers support in Russian.
Where do I set tokens and other secret values?
Every project has a Secrets tab where you set the values from your code — for example the token from BotFather. We store them encrypted: you can see the variable names, but the values are shown to no one, including you.
Why does my website sometimes sleep?
On the free plan, websites sleep after being idle and wake up in a couple of seconds on the first request. On the Pro plan your project runs without sleeping.