
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeDeploying an embedded Sanity Studio in Next.js is straightforward once you understand the routing requirements. Here's how to deploy your embedded studio that's currently running at http://localhost:3000/studio:
The good news is that deploying an embedded Sanity Studio works the same way as deploying any Next.js application. When you deploy your Next.js app to platforms like Vercel, Netlify, or any other hosting provider, your embedded Studio will deploy along with it automatically.
You must add your production domain to your Sanity project's CORS origins settings. This is easy to forget but essential:
https://yourdomain.com)Without this, your Studio won't be able to authenticate users or save content in production.
Your Studio needs proper routing to handle all sub-routes. According to the next-sanity documentation, if you're using the App Router, your file structure should look like:
app/studio/[[...index]]/page.tsx
This [[...index]] catch-all route ensures all Studio sub-routes (like /studio/desk/post or /studio/structure) are properly handled. Inside this file, you'll have something like:
import { NextStudio } from 'next-sanity/studio'
import config from '@/sanity.config'
export default function StudioPage() {
return <NextStudio config={config} />
}The embedding documentation confirms you need to ensure all sub-routes of the basePath redirect to this route.
Make sure your production environment has the required environment variables set:
NEXT_PUBLIC_SANITY_PROJECT_ID=your-project-id
NEXT_PUBLIC_SANITY_DATASET=productionMost hosting platforms (Vercel, Netlify, etc.) have settings pages where you can add these.
Ensure your Studio has proper styling as mentioned in the embedding documentation:
/* Applied to the container where Studio mounts */
#app {
height: 100vh;
max-height: 100dvh;
overscroll-behavior: none;
-webkit-font-smoothing: antialiased;
overflow: auto;
}NEXT_PUBLIC_SANITY_PROJECT_IDNEXT_PUBLIC_SANITY_DATASETYour Studio will be available at https://yourdomain.com/studio
Similar process:
netlify.toml:[[redirects]] from = "/studio/*" to = "/studio" status = 200
After deployment:
https://yourdomain.com/studioIf you prefer not to embed the Studio in your Next.js app, you can also deploy it separately using:
sanity deployThis hosts it on Sanity's infrastructure at your-project.sanity.studio. This is simpler but gives you less control over customization and integration with your frontend.
The embedded approach you're using is great for having everything in one place and gives you more flexibility for custom integrations!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store