---
title: "Deployment · Sanity × Nuxt UI"
description: "Host the Studio on Sanity and the site on Vercel, Cloudflare or any Node server."
canonical_url: "https://sanity-nuxtui.vercel.app/docs/deployment"
meta:
  "og:description": "Host the Studio on Sanity and the site on Vercel, Cloudflare or any Node server."
  "og:image": "https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Deployment%2Cdescription_~SG9zdCB0aGUgU3R1ZGlvIG9uIFNhbml0eSBhbmQgdGhlIHNpdGUgb24gVmVyY2VsLCBDbG91ZGZsYXJlIG9yIGFueSBOb2RlIHNlcnZlci4%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9kb2NzL2RlcGxveW1lbnQi%2Cs_RsKMUMxXZVpaQuUv.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Deployment · Sanity × Nuxt UI"
  "twitter:image": "https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Deployment%2Cdescription_~SG9zdCB0aGUgU3R1ZGlvIG9uIFNhbml0eSBhbmQgdGhlIHNpdGUgb24gVmVyY2VsLCBDbG91ZGZsYXJlIG9yIGFueSBOb2RlIHNlcnZlci4%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9kb2NzL2RlcGxveW1lbnQi%2Cs_RsKMUMxXZVpaQuUv.png"
---

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

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

# **Deployment**

Host the Studio on Sanity and the site on Vercel, Cloudflare or any Node server.

The Studio and the site deploy separately. Content changes never need a deploy; code changes do.

## Studio

```
pnpm --filter studio exec sanity deploy --url your-name
```

The first deploy publishes the Studio at `https://your-name.sanity.studio` and prints an app ID. Put it in `SANITY_STUDIO_APP_ID` in `apps/studio/.env`, so `pnpm deploy:studio` updates the same Studio afterwards. Then allow the Studio in CORS:

```
pnpm --filter studio exec sanity cors add https://your-name.sanity.studio --credentials
```

`SANITY_STUDIO_*` variables are built into the Studio, so redeploy after changing them. Put production values, such as the site address for the preview, in `apps/studio/.env.production`.

To host the Studio yourself, run `pnpm --filter studio build` and serve `apps/studio/dist`.

## Environment variables (site)

Set them as build variables: the project ID and site URL are read at build time.

| **Variable** | **Required** | **Purpose** |
| --- | --- | --- |
| `NUXT_SANITY_PROJECT_ID` | yes | Sanity project ID |
| `NUXT_SANITY_DATASET` | yes | Dataset, usually `production` |
| `NUXT_SITE_URL` | yes | Public URL, e.g. `https://example.com` |
| `NUXT_APP_SECRET` | yes | Signs social image URLs. `npx nuxt-og-image generate-secret` |
| `NUXT_SITE_NAME` | no | Fallback site name |
| `NUXT_CACHE_TTL` | no | Seconds before a cached page refreshes. Default `60`; `0` turns caching off |
| `NUXT_RENDER_MODE` | no | `ssr` (default), `hybrid` or `static` |
| `NUXT_SANITY_API_READ_TOKEN` | no | Enables Visual Editing |
| `NUXT_SANITY_STUDIO_URL` | no | The Studio address, for Visual Editing |

After deploying, add the site to CORS (`sanity cors add https://example.com --credentials`) for search and Visual Editing.

## Vercel

1. Import the repository and set ****Root Directory**** to `apps/web`. The Nuxt preset is detected.
2. Add the environment variables.
3. Deploy. ISR and social images work without further setup.

For Visual Editing, add the read token and the Studio URL to the same project and redeploy; pages stay cached for visitors.

## Cloudflare Workers

1. In the Cloudflare dashboard, create a Worker from the Git repository with:
   - ****Root directory****: `apps/web`
   - ****Build command****: `pnpm build`
   - ****Deploy command****: `npx wrangler deploy`
   - ****Build variables****: the variables above, plus `NITRO_PRESET=cloudflare_module`
2. Add `NUXT_APP_SECRET` as a ****secret**** of the Worker too, since it is read at runtime.

The build generates the Wrangler config with the bindings social images need. The Worker is about 2.8 MB gzipped, inside the 3 MB limit of the free plan.

To deploy from your machine: `NITRO_PRESET=cloudflare_module pnpm --filter web build`, then `npx wrangler --cwd apps/web/.output deploy`.

## Cloudflare Pages

- ****Static****: build command `pnpm generate`, output directory `apps/web/.output/public`.
- ****Hybrid****: build variables `NITRO_PRESET=cloudflare_pages` and `NUXT_RENDER_MODE=hybrid`, build command `pnpm build`, root directory `apps/web`, output directory `dist`.

## Any Node host

```
pnpm --filter web buildnode apps/web/.output/server/index.mjs
```

[**Rendering and caching** Choose between server rendering, hybrid prerendering and a static site, and how pages are cached.](https://sanity-nuxtui.vercel.app/docs/rendering-and-caching) [**Writing these docs** How the guides are written in Markdown and imported into the Docs collection.](https://sanity-nuxtui.vercel.app/docs/writing-docs)

```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/docs/deployment#webpage","@type":"WebPage","dateModified":"2026-10-16T02:29:18Z","description":"Host the Studio on Sanity and the site on Vercel, Cloudflare or any Node server.","name":"Deployment","url":"https://sanity-nuxtui.vercel.app/docs/deployment","isPartOf":{"@id":"https://sanity-nuxtui.vercel.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://sanity-nuxtui.vercel.app/docs/deployment"]}]},{"@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/docs/deployment#article","@type":"Article","dateModified":"2026-10-16T02:29:18Z","description":"Host the Studio on Sanity and the site on Vercel, Cloudflare or any Node server.","headline":"Deployment","inLanguage":"en","thumbnailUrl":"https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Deployment%2Cdescription_~SG9zdCB0aGUgU3R1ZGlvIG9uIFNhbml0eSBhbmQgdGhlIHNpdGUgb24gVmVyY2VsLCBDbG91ZGZsYXJlIG9yIGFueSBOb2RlIHNlcnZlci4%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9kb2NzL2RlcGxveW1lbnQi%2Cs_RsKMUMxXZVpaQuUv.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/docs/deployment#webpage"},"mainEntityOfPage":{"@id":"https://sanity-nuxtui.vercel.app/docs/deployment#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_Deployment%2Cdescription_~SG9zdCB0aGUgU3R1ZGlvIG9uIFNhbml0eSBhbmQgdGhlIHNpdGUgb24gVmVyY2VsLCBDbG91ZGZsYXJlIG9yIGFueSBOb2RlIHNlcnZlci4%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9kb2NzL2RlcGxveW1lbnQi%2Cs_RsKMUMxXZVpaQuUv.png","inLanguage":"en","url":"https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Deployment%2Cdescription_~SG9zdCB0aGUgU3R1ZGlvIG9uIFNhbml0eSBhbmQgdGhlIHNpdGUgb24gVmVyY2VsLCBDbG91ZGZsYXJlIG9yIGFueSBOb2RlIHNlcnZlci4%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9kb2NzL2RlcGxveW1lbnQi%2Cs_RsKMUMxXZVpaQuUv.png"}]}
```

## Sitemap

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