Sanity is a platform for creating and working with structured content. Your content is stored in the cloud and can be distributed anywhere, for example on a website or in an app.
This step will help you create a Sanity project.
You can follow the video, read the instructions, or do both – depending on your preferred learning style.
👉 Look for the pointing finger emoji to quickly locate the actionable steps in the guide if you prefer more action and less explanation.
To install Sanity Studio you'll first need to have node and npm installed.
👉 To get started, run this in your command line:
npx -y @sanity/cli init --template empty --create-project "Sanity Project" --dataset production
I get "Template 'empty' not found"
Your Sanity CLI is out of date and doesn’t have this starter template. To use the latest version, instead run the following command in your shell:
npx -y @sanity/cli@latest init --template empty --create-project "Sanity project" --dataset production
I get "EACCESS: permission denied"
We recommend you reinstall npm with a node version manager by following this guide from from npm.
I get "Failed to communicate with the Sanity API"
You’re probably logged in with a different account than the one you used to create this project. Use the npx -y @sanity/cli logout command as shown below, as well as making sure your CLI is up to date.
npx @sanity/cli logout && npx -y @sanity/cli init --template empty --create-project "Sanity project" --dataset production
Are you still stuck?
Please describe your problem as detailed as you can in our Slack community. We have a dedicated #getting-started channel to assist you.
This will take you through a setup process by guiding you through the following steps:
- 👉 Create an account. Select a login provider from the list of options, and confirm with Enter. After creating an account in the browser, come back to the command line window.
- 👉 Choose an output path. Press
Enterto accept the default path, or change it to fit your needs first.
- 👉 Wait a bit for the installation process to complete. When you get a
Success!message, you're good to move on to the next step! 🎉
Having installed the studio in the previous step, it’s time to start it up and run it in your browser!
👉 Enter the Studio's directory:
If you chose a custom output path, remember to change it respectively.
👉 Run this command within the Studio's folder:
npx @sanity/cli start
This will build the studio application and start a local development server so you can run the app in your browser. Once the build is complete, you can head over to http://localhost:3333.
You should now see the Sanity Studio running in your browser!
As you modify and save the code, the server will automatically rebuild the studio and refresh the browser.
You can stop your development server by pressing
Ctrl-C in the terminal where the server is running.
At this point, we've set up the following:
- Sanity account – you need it to access your projects.
- Sanity project – a place for your content represented as documents, stored by Sanity in the cloud. A single Sanity account can have unlimited number of Sanity projects.
- Sanity Studio – a React app to edit and publish content. Connected to a Sanity project via APIs. For now, it is installed on your computer. In the next steps, we'll cover how to deploy it to the web and share it with others.
Join our Slack community to ask questions and get help!
Join Slack Community