Deploy a SvelteKit App
This tutorial walks you through deploying a SvelteKit application on Temps. SvelteKit supports static, server-rendered, and hybrid output — all work on Temps.
What you will build
- A SvelteKit app deployed from a Git repository
- SSR with the Node adapter or static prerendering
- Automatic HTTPS and deployment on every push
Time required: 10 minutes.
Prerequisites:
- A running Temps instance (install guide)
- A SvelteKit app in a Git repository
- (Optional) A custom domain
Step 1: Prepare your app
Install the Node adapter
For SSR deployments, use the Node adapter:
npm install -D @sveltejs/adapter-node
Update your svelte.config.js:
svelte.config.js
import adapter from '@sveltejs/adapter-node';
export default {
kit: {
adapter: adapter()
}
};
For static sites, use @sveltejs/adapter-static instead.
Verify your package.json
package.json
{
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/adapter-node": "^5.0",
"@sveltejs/kit": "^2.0",
"svelte": "^5.0",
"vite": "^6.0"
}
}
Add a health check
src/routes/health/+server.js
import { json } from '@sveltejs/kit';
export function GET() {
return json({ status: 'ok' });
}
Step 2: Create a project
- Open the Temps dashboard
- Click New Project
- Connect your repository
- Temps detects SvelteKit automatically
Or via CLI:
bunx @temps-sdk/cli projects create -n "my-svelte-app" -d "SvelteKit application"
bunx @temps-sdk/cli projects git -p my-svelte-app --owner yourorg --repo my-svelte-app --branch main -y
Step 3: Create a Dockerfile (optional)
Temps auto-detects SvelteKit, but you can customize:
Dockerfile
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/build ./build
COPY --from=builder /app/package.json .
EXPOSE 3000
CMD ["node", "build"]
Step 4: Deploy
Push to your connected branch, or deploy manually:
bunx @temps-sdk/cli deploy my-svelte-app -b main -e production -y
Environment variables
SvelteKit uses PUBLIC_ prefixed variables for client-side access:
# Server-only (available in +server.js, +page.server.js, hooks)
DATABASE_URL=postgres://user:pass@host:5432/db
API_SECRET=your-secret
# Available in client-side code
PUBLIC_API_URL=https://api.example.com
PUBLIC_ variables are embedded at build time. Redeploy after changing them. Server-only variables are available at runtime.
What to do next
- Add a custom domain — point your domain to this deployment
- Set up preview deployments — get a preview URL for every pull request
- Add monitoring — uptime checks and alerts