---
title: "Postgres SvelteKit Starter"
description: "Simple SvelteKit template that uses a Postgres database."
url: "https://vercel.com/templates/svelte/postgres-sveltekit"
links:
  repository: "https://github.com/vercel/examples/tree/main/storage/postgres-sveltekit"
  demo: "https://postgres-sveltekit.vercel.app/"
  deploy: "https://vercel.com/new/clone?demo-title=Postgres+SvelteKit+Starter&demo-description=Simple+SvelteKit+template+that+uses+a+Postgres+database.&demo-url=https%3A%2F%2Fpostgres-sveltekit.vercel.app%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F3gNdMYQLSPE4ZelI2fWF6l%2F3d15b1e6a48b7782c0c1ad58c6a3f2c5%2FCleanShot_2023-05-01_at_11.22.15.png&project-name=Postgres+SvelteKit+Starter&repository-name=postgres-sveltekit&repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fexamples%2Ftree%2Fmain%2Fstorage%2Fpostgres-sveltekit&from=templates&skippable-integrations=1&products=%5B%7B%22type%22%3A%22integration%22%2C%22group%22%3A%22postgres%22%2C%22protocol%22%3A%22storage%22%7D%5D"
---

# Postgres SvelteKit Starter

Simple SvelteKit template that uses a Postgres database.

# Postgres SvelteKit Starter

Simple SvelteKit template that uses a Postgres database.

## Demo

https://postgres-sveltekit.vercel.app/

## How to Use

You can choose from one of the following two methods to use this repository:

### One-Click Deploy

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=vercel-examples)

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fexamples%2Ftree%2Fmain%2Fstorage%2Fpostgres-sveltekit&project-name=postgres-sveltekit&repository-name=postgres-sveltekit&demo-title=Vercel%20Postgres%20Next.js%Sveltekit&demo-description=Simple%20Next.js%20template%20that%20uses%20Vercel%20Postgres%20as%20the%20database.&demo-url=https%3A%2F%2Fpostgres-sveltekit.vercel.app%2F&demo-image=https%3A%2F%2Fpostgres-starter.vercel.app%2Fopengraph-image.png&products=%5B%7B%22type%22%3A%22integration%22%2C%22group%22%3A%22postgres%22%7D%5D)

### Clone and Deploy

Execute the following command to download the example into the `my-project` folder:

```bash
npx degit@latest https://github.com/vercel/examples/storage/postgres-sveltekit my-project
```

Once you've created the project and installed dependencies with `pnpm install`, copy the `.env.example` file in this directory to `.env.local` (which will be ignored by Git). Then open `.env.local` and set the environment variables to match the ones in your Vercel Storage Dashboard.

Alternatively, if you have setup a project already and you have installed the Vercel CLI, you can also pull the environment variables using the following command:

```bash
vercel env pull .env.local
```

Next, run SvelteKit in development mode:

```bash
pnpm dev
```

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=vercel-examples) ([Documentation](https://vercel.com/docs/frameworks/sveltekit)).

## Related Templates

### [Postgres Next.js Starter](https://vercel.com/templates/next.js/postgres-starter)

Simple Next.js template that uses a Postgres database.

### [Postgres + Kysely Next.js Starter](https://vercel.com/templates/next.js/postgres-kysely)

Simple Next.js template that a Postgres database and Kysely as the query builder.

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
