---
title: "Getting Started in 6 Simple Steps | SanityPress with Typegen"
description: "Get your SanityPress website up and running in 6 simple steps."
---

# Getting started

🚀 Simple 6-step setup

On this page
1. [1\. Initialize the template](#initialize-the-template)
2. [2\. Set environment variables](#set-environment-variables)
3. [3\. Install and start local server](#install-and-start-local-server)
4. [4\. Add content into your Sanity Studio](#add-content-into-your-sanity-studio)
5. [5\. Set up deployments](#set-up-deployments)
6. [6\. Customize](#customize)

### What does the backend look like?

[Explore the Studio](https://sanitypress.dev/docs/sanity-studio-screenshots)

## 1\. Initialize the template

Click the [Sanity template link](https://www.sanity.io/get-started?template=sanitypress) \-- _OR_ \-- install with the Sanity CLI:

```
npm create sanity@latest -- --template=nuotsu/sanitypress
```

## 2\. Set environment variables

If initialized via the Sanity template link, the `.env.local` file should be created automatically.

If initialized via the CLI, duplicate the `.env.example` file as `.env.local` and assign the variables to your project:

* .env.local

```
NEXT_PUBLIC_BASE_URL="https://example.com" # your website's domain

NEXT_PUBLIC_SANITY_PROJECT_ID="abcd1234" # Sanity project id
NEXT_PUBLIC_SANITY_DATASET="production" # Sanity dataset name

SANITY_API_READ_TOKEN="..." # API token with "Viewer" permissions
```

> **⚠️ Required:** Set `NEXT_PUBLIC_BASE_URL` to your production domain.

## 3\. Install and start local server

Install required packages and dependencies with your desired package manager (e.g. npm, pnpm, deno, bun, etc.).

```
npm install
```

Once installed, run the development script to start the local server:

```
npm run dev
```

and open:

* Next.js frontend: <http://localhost:3000>
* Sanity Studio: <http://localhost:3000/admin>

## 4\. Add content into your Sanity Studio

Publish the **required** documents: `site` and `page` (with the slug "index"). Otherwise, you’ll just see a blank page on the Next.js frontend.

What you’ll need:

| Document      | Slug or Path | Usage                       | Required? | Notes                                |
| ------------- | ------------ | --------------------------- | --------- | ------------------------------------ |
| site          |              | Global settings             | Yes       |                                      |
| page          | index        | Homepage route              | Yes       |                                      |
| page          | 404          | Not found route             |           |                                      |
| page          | blog         | Blog index (homepage) route |           | Add the **Blog index** module        |
| global-module | blog/        | Blog post template          |           | Add the **Blog post content** module |

Alternatively, you can run the following command to import a demo dataset with the required documents:

```
sanity dataset import demo.tar.gz
```

> 📸 See what the Sanity Studio backend looks like on the [Screenshots page](https://sanitypress.dev/sanity-studio-screenshots).

## 5\. Set up deployments

Add a [Vercel](https://www.sanity.io/plugins/vercel-dashboard-widget) (default) or [Netlify](https://www.sanity.io/plugins/sanity-plugin-dashboard-widget-netlify) widget to enable deployments from the Studio.

## 6\. Customize

Adjust frontend styles to your liking, edit or add new schema and modules, etc.

1. [Home](https://sanitypress.dev/)
2. [Docs](https://sanitypress.dev/docs)
3. Getting Started

## Stop Scaffolding. Start Shipping.

[🚀 Start building](https://sanitypress.dev/docs/getting-started)[⭐ Star on GitHub](https://sanitypress.dev/repo)
