👀 Our most exciting product launch yet 🚀 Join us May 8th for Sanity Connect

Installation

How to install and initiate a new Sanity Studio project

If you’re new to Sanity, we recommend exploring the different ways of getting started as this article won't go into any detail beyond the installation instructions.

Initiating a new Studio from the CLI

Launching a studio from the CLI is typically useful when you:

  • are starting a new project
  • prefer to figure tools out on your own
  • need to set up a content backend quickly

To install and run the Sanity Studio development server locally, you will need to have Node and npm installed (or an npm-compatible JavaScript runtime).

To initiate a new Studio, you can run the following command using a package manager:

npm create sanity@latest

# Alternatives
yarn create sanity@latest
pnpm create sanity@latest

The CLI will take you through creating or signing into an account and choosing a studio template, TypeScript, preferred package manager, etc. It will make a new folder on the desired path and bootstrap a studio with the necessary configuration.

Once the CLI has installed the studio, you can cd go into the studio folder and run npm run dev to start the local development server.

Adding Sanity to an existing project

Sanity Studio is ESM-ready as a single dependency and a React component. That means that you can mount the Studio application in any web application as long as the hosting provider supports adding redirects to all of the Studio's sub-routes.

Learn more about embedding the Studio in other projects.

Was this article helpful?