Start Sanity frontend only without studio on localhost:3000

6 replies
Last updated: Mar 25, 2021
Is there a command to start frontend only at localhost3000 without opening the studio. I usually run npm start to run both studio and frontend , which i think is the reason why my computer is slowing down in performance.
AI Update

It sounds like you have a Next.js project with an embedded Sanity Studio, and running npm start is launching both together. You're right that running both can be resource-intensive!

The solution depends on your project setup:

If you have a Next.js app with embedded Studio:

Your package.json likely has scripts that look something like this:

"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start"
}

If npm start runs both, it's probably because your Studio is embedded in your Next.js app (like at /studio route). In this case:

  1. To run only the frontend: Just use npm run dev (or next dev) - this starts the Next.js dev server at localhost:3000
  2. To run only the Studio: Navigate to your studio directory and run sanity dev (this typically runs on localhost:3333)

If you have separate folders for frontend and studio:

Navigate to just the frontend folder and run:

cd frontend  # or whatever your frontend folder is named
npm run dev

Performance tip: The Next.js development server at localhost:3000 is your frontend. The Sanity Studio (typically at localhost:3333 or embedded at /studio) is a separate React application. If you only need to work on the frontend and don't need to edit content, you can absolutely skip running the Studio - your frontend will still fetch published content from Sanity's hosted Content Lake.

Check your package.json to see what npm start actually runs - it might be calling a custom script that launches both processes. You can modify it or just use the individual commands instead. If the Studio is embedded as a route in your Next.js app, it will load when you visit that route, but if you just work on your frontend pages, it won't consume resources until you navigate to it.

Show original thread
6 replies
Are you referring to the starter? If so, you can start the frontend only by going into
/web
and run
npm start
there instead
Yes the e-commerce starter ,sorry should have mentioned that.Thanks
🙌
well just found out there is no web folder in next js starters
ah I see, the e-commerce starter is different to the older starters
I haven’t looked into the e-commerce starter at all, but it doesn’t look like
npm start
runs the studio as well.
npm run dev
does. You could just run
next dev
instead of
npm run dev
thanks
next dev
works!

Sanity – Build the way you think, not the way your CMS thinks

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.

Was this answer helpful?