Deploy a SvelteKit-App to DigitalOcean
A quick guide on how to deploy your SvelteKit-App to the DigitalOcean App Platform

Hey there, I'm a young developer building software on the web. Currently building snippet.land and Tubitor.
Search for a command to run...
A quick guide on how to deploy your SvelteKit-App to the DigitalOcean App Platform

Hey there, I'm a young developer building software on the web. Currently building snippet.land and Tubitor.
Thank you so much.. this worked for me after being confused why it fails to deploy.
Hi,
thanks for this blog! I am currently thinking about moving my sveltekit project to Digitalocean App platform.
I am curious to know which sveltekit adapter you have used for deployment?
Thanks!
Hi, thanks for your comment! I've used the auto adapter: '@sveltejs/adapter-auto'
Thanks, for your fast reply! I really appreciate it! Have you experimented with different adapters? Are there any performance differences?
In general: Do you experience any issues or problems using the DigitalOcean App Platform?
Harnessing Object-Oriented Techniques: A Deep Dive into PHP Class Inheritance

Matt Mullenweg wasn't lying when he said he would go "nuclear" against WP Engine. But his attack expanded beyond WP Engine and now hits the entire WordPress ecosystem. What has started as an attempt to get WP Engine to pay a trademark license to Auto...

Understanding Classes in PHP for Better Code Structure

Transform Your PHP Code with the Power of Object-Oriented Programming

Create and Store QR Codes in Laravel 11 Using the Laravel QR Code Package

Hii ๐
here on my blog and on Twitter, I've said very often that SvelteKit is awesome. So in this guide, I'll show you how you can deploy and host your SvelteKit-App.
To follow along, you obviously need a SvelteKit-App you want to deploy. If you don't have one, I've already written an article on how to set up SvelteKit.
There are multiple ways you can create an app on the DigitalOcean App Platform. You need to choose between one of these sources:
I've only tested it with GitHub and that's what I'm using in this demo. To follow along, I assume you have your SvelteKit-App stored in a GitHub repository.
By default, the app Platform uses NodeJS version 12. You can change the NodeJS version in the package.json file. I'll change the version to NodeJS 16.13.1.
{
"engines": {
"node": "16.13.1"
},
"name": "..."
}
In order for your app to be accessible, the host must be exposed. We can do this with a simple --host flag on the preview command in the package.json:
{
"scripts": {
"dev": "svelte-kit dev",
"build": "svelte-kit build",
"package": "svelte-kit package",
"preview": "HOST=0.0.0.0 svelte-kit preview --host",
},
}
If you're ready to deploy, head over to DigitalOcean and create a new app. In the source selection, select the source where your app's source code is hosted.
In the next step, you'll be asked for a unique name for your app. Also, you need to choose the branch that'll be used as the source for the deployments. If you push an update to this branch, the app will re-deploy automatically (you can disable this later).
Next up, choose "Web service" as the type for the component (one app can have multiple components. The SvelteKit-App is one component). Settings:
/npm run buildnpm run preview3000You can also add environment variables here if you want (can be changed later).
After this configuration, move on to the plan selection. Make sure you're using at least the Basic-Plan because in order for our SvelteKit-App to work we need the "dynamic-apps" feature.
If you're just getting started, the smallest container size for 5$ / month is most likely enough for you.
Now you can hit launch and wait for the deployment process to be finished.
Here are some settings you might want to change:
And that's it for this article - I hope this helped you and you can now deploy your SvelteKit-App easy and fast ๐ฅ
Thank you so much for reading and I'll see you in the next one ๐