run sveltekit on (linux) plesk obsidian hosting

run sveltekit on (linux) plesk obsidian hosting

It's been a while since I focussed on my sveltekit passion and since then sveltekit and plesk made some progress.

Sveltekit might feel demanding when you try to host it yourself on a linux plesk server and this post demonstrates how to set up your hosting.

tl;dr;

Use @sveltejs/adapter-node as adapter and configure it this way:

// svelte.config.js
import adapter from '@sveltejs/adapter-node';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	kit: {
		adapter: adapter({
			out: ".dist",
		})
	}
};

export default config;

Next, create an index.cjs file in your project root with this content:

// index.cjs
(() => import("./.dist/index.js"))();

Configure your domain configuration to use node 18.9.1 and run build script.

Select ./index.cjs as your Application Startup File. And start your Node JS Application.

A more detailed description coming soon.

Article Image from Johnny McClung via unsplash and ghost