---
title: "Installation · Sanity × Nuxt UI"
description: "Set up the template locally, connect it to a Sanity project and add the example content."
canonical_url: "https://sanity-nuxtui.vercel.app/id/docs/installation"
meta:
  "og:description": "Set up the template locally, connect it to a Sanity project and add the example content."
  "og:image": "https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Installation%2Cdescription_~U2V0IHVwIHRoZSB0ZW1wbGF0ZSBsb2NhbGx5LCBjb25uZWN0IGl0IHRvIGEgU2FuaXR5IHByb2plY3QgYW5kIGFkZCB0aGUgZXhhbXBsZSBjb250ZW50Lg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9pZC9kb2NzL2luc3RhbGxhdGlvbiI%2Cs_i97B8KoYEs63FTHO.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Installation · Sanity × Nuxt UI"
  "twitter:image": "https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Installation%2Cdescription_~U2V0IHVwIHRoZSB0ZW1wbGF0ZSBsb2NhbGx5LCBjb25uZWN0IGl0IHRvIGEgU2FuaXR5IHByb2plY3QgYW5kIGFkZCB0aGUgZXhhbXBsZSBjb250ZW50Lg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9pZC9kb2NzL2luc3RhbGxhdGlvbiI%2Cs_i97B8KoYEs63FTHO.png"
---

> Index of every page on this site: [llms.txt](https://sanity-nuxtui.vercel.app/llms.txt)

Halaman ini belum tersedia dalam bahasa Indonesia.

[Docs](https://sanity-nuxtui.vercel.app/id/docs)

# **Installation**

Set up the template locally, connect it to a Sanity project and add the example content.

## Requirements

- Node.js 24 or later
- pnpm
- A [**Sanity**](https://www.sanity.io) account (the free plan is enough)

## 1. Get the code

```
git clone https://github.com/narr07/sanity-nuxtui.git my-sitecd my-sitepnpm install
```

The repository is a pnpm workspace with two apps: `apps/studio` (Sanity Studio) and `apps/web` (the Nuxt site).

## 2. Create a Sanity project

Create a project at [**sanity.io/manage**](https://www.sanity.io/manage) and copy its ****project ID****. Or let the CLI do it:

```
pnpm --filter studio exec sanity init --bare
```

The template expects a dataset called `production` with ****public**** visibility, the default for new projects.

## 3. Configure the environment

```
cp apps/studio/.env.example apps/studio/.envcp apps/web/.env.example apps/web/.env
```

All variables are described in [**Deployment**](https://sanity-nuxtui.vercel.app/docs/deployment).

## 4. Log in and allow the site to read content

```
pnpm --filter studio exec sanity loginpnpm --filter studio exec sanity cors add http://localhost:3000 --credentials
```

**Use the same login method every time**

Sanity treats Google, GitHub and email logins as separate accounts. Log in with the one that owns the project.

## 5. Add the example content

```
pnpm seed
```

This creates the pages, the Blog, Gallery and Projects collections, two authors, these docs and the site settings, with photos from Unsplash. It refuses to run when the dataset already has content; `pnpm seed --replace` deletes the template's document types first.

## 6. Run

```
pnpm dev
```

| **App** | **Address** |
| --- | --- |
| Site | `http://localhost:3000` |
| Studio | `http://localhost:3333` |

If port 3000 is taken, Nuxt picks the next free port. Update `SANITY_STUDIO_PREVIEW_URL` in `apps/studio/.env` and add that origin to CORS as well.

## Scripts

Run them from the repository root.

| **Command** | **Description** |
| --- | --- |
| `pnpm dev` | Studio and site together |
| `pnpm dev:web` / `pnpm dev:studio` | One of them |
| `pnpm build` | Build both |
| `pnpm generate` | Build the site as static files |
| `pnpm typegen` | Extract the schema and regenerate `apps/web/sanity.types.ts` |
| `pnpm seed` | Add the example content (`--replace` to start over) |
| `pnpm docs:import` | Import the Markdown guides in `docs/` into the Docs collection |
| `pnpm deploy:studio` | Deploy the Studio to `<name>.sanity.studio` |
| `pnpm lint` / `pnpm typecheck` | Check the site |

[**SEO and sharing** How pages appear in search results and when links are shared.](https://sanity-nuxtui.vercel.app/id/docs/seo) [**Project structure** Where everything lives in the two apps.](https://sanity-nuxtui.vercel.app/id/docs/project-structure)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://sanity-nuxtui.vercel.app/#website","@type":"WebSite","name":"Sanity × Nuxt UI","url":"https://sanity-nuxtui.vercel.app/","publisher":{"@id":"https://sanity-nuxtui.vercel.app/#identity"}},{"@id":"https://sanity-nuxtui.vercel.app/id/docs/installation#webpage","@type":"WebPage","dateModified":"2026-10-16T02:29:18Z","description":"Set up the template locally, connect it to a Sanity project and add the example content.","name":"Installation","url":"https://sanity-nuxtui.vercel.app/id/docs/installation","isPartOf":{"@id":"https://sanity-nuxtui.vercel.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://sanity-nuxtui.vercel.app/id/docs/installation"]}]},{"@id":"https://sanity-nuxtui.vercel.app/#identity","@type":"Organization","name":"Sanity × Nuxt UI","url":"https://sanity-nuxtui.vercel.app"},{"@id":"https://sanity-nuxtui.vercel.app/id/docs/installation#article","@type":"Article","dateModified":"2026-10-16T02:29:18Z","description":"Set up the template locally, connect it to a Sanity project and add the example content.","headline":"Installation","inLanguage":"en","thumbnailUrl":"https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Installation%2Cdescription_~U2V0IHVwIHRoZSB0ZW1wbGF0ZSBsb2NhbGx5LCBjb25uZWN0IGl0IHRvIGEgU2FuaXR5IHByb2plY3QgYW5kIGFkZCB0aGUgZXhhbXBsZSBjb250ZW50Lg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9pZC9kb2NzL2luc3RhbGxhdGlvbiI%2Cs_i97B8KoYEs63FTHO.png","author":{"@id":"https://sanity-nuxtui.vercel.app/#identity"},"image":{"@id":"https://sanity-nuxtui.vercel.app/#/schema/image/1"},"isPartOf":{"@id":"https://sanity-nuxtui.vercel.app/id/docs/installation#webpage"},"mainEntityOfPage":{"@id":"https://sanity-nuxtui.vercel.app/id/docs/installation#webpage"},"publisher":{"@id":"https://sanity-nuxtui.vercel.app/#identity"}},{"@id":"https://sanity-nuxtui.vercel.app/#/schema/image/1","@type":"ImageObject","contentUrl":"https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Installation%2Cdescription_~U2V0IHVwIHRoZSB0ZW1wbGF0ZSBsb2NhbGx5LCBjb25uZWN0IGl0IHRvIGEgU2FuaXR5IHByb2plY3QgYW5kIGFkZCB0aGUgZXhhbXBsZSBjb250ZW50Lg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9pZC9kb2NzL2luc3RhbGxhdGlvbiI%2Cs_i97B8KoYEs63FTHO.png","inLanguage":"en","url":"https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Installation%2Cdescription_~U2V0IHVwIHRoZSB0ZW1wbGF0ZSBsb2NhbGx5LCBjb25uZWN0IGl0IHRvIGEgU2FuaXR5IHByb2plY3QgYW5kIGFkZCB0aGUgZXhhbXBsZSBjb250ZW50Lg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9pZC9kb2NzL2luc3RhbGxhdGlvbiI%2Cs_i97B8KoYEs63FTHO.png"}]}
```

## Sitemap

See the full [sitemap](https://sanity-nuxtui.vercel.app/sitemap.md) for all pages.
