---
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

## 1. Initialize the template

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

```sh
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:

```sh
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.).

```sh
npm install
```

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

```sh
npm run dev
```

Then open:

- Next.js frontend: [http://localhost:3000](http://localhost:3000)
- Sanity Studio: [http://localhost:3000/admin](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:

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

> 📸 See what the Sanity Studio backend looks like on the [Screenshots page](/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.
