---
title: "Walkthrough: Setting up a development environment with the Sitecore Containers template for Next.js"
slug: "walkthrough--setting-up-a-development-environment-with-the-sitecore-containers-template-for-next-js"
abstract: "Get started with full-stack Sitecore JSS and Next.js development"
---
# Walkthrough: Setting up a development environment with the Sitecore Containers template for Next.js

Using the Sitecore Containers template for Next.js you can create a full-stack, [Sitecore-first](https://doc.sitecore.com/xp/en/developers/hd/23/sitecore-headless-development/sitecore-first-development-workflow.html "Sitecore-first development workflow") JSS Next.js project.

This walkthrough describes the steps for setting up your development environment using [the Sitecore containers template for Next.js](https://doc.sitecore.com/xp/en/developers/hd/23/sitecore-headless-development/the-sitecore-containers-template-for-jss-next-js-apps.html "The Sitecore Containers template for JSS Next.js apps").

Before you can install the template and create a full-stack solution for Sitecore and JSS for Next.js, you must have the following software components on your workstation:

- A valid Sitecore license file.
- Windows PowerShell 5.1. PowerShell 7 is not supported at this time.
- A current version of [Node.js](https://nodejs.org/). We recommend using the most recent long-term support (LTS) version.
- [.NET Core 3.1 SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1) (check your installed version with the `dotnet --version` command).
- [.NET Framework 4.8 SDK](https://dotnet.microsoft.com/download/dotnet-framework/net48) (see the [Microsoft procedure for checking .NET Framework versions](https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed)).
- [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/).
- [Docker for Windows](https://docs.docker.com/docker-for-windows/install/), with *Windows Containers* enabled.
- Any required components for [using Sitecore Containers](https://doc.sitecore.com/xp/en/developers/104/developer-tools/en/set-up-the-environment.html).
- [Git](https://git-scm.com/)

> [!note]
> This template configures a development environment for the current release of Sitecore XP and JSS. To find out which version of JSS to use with your licensed Sitecore XP version, consult [the Sitecore compatibility table](https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0541788).

This walkthrough describes how to:

- Install the template.
- Create the project solution.
- Rebuild search indexes.

## Install the template

Before you can create a solution, you must download and install the .NET `sitecore.nextjs.gettingstarted` template in your file system.

To install the template:

1. Open PowerShell with administrator privileges.
2. Run the following command:

    ```text
    dotnet new -i Sitecore.DevEx.Templates --nuget-source https://nuget.sitecore.com/resources/v3/index.json
    ```

    > [!note]
    > The dotnet tool does not provide obvious feedback that the installation was successful. However, the install command ends by listing all of the installed templates. If the installation is successful, the list includes `sitecore.nextjs.gettingstarted`.

## Create the project solution

You can name your solution anything you like, but we name the solution `MyProject` in this example.

> [!important]
> Do not use non-Latin characters in the project/folder name. Using non-Latin characters can give unexpected results because of character limitations in Docker registry names and URLs.

To create the `MyProject` solution:

1. Open PowerShell with administrator privileges.
2. Check if you have the Internet Information Server running on port 443:

    ```text
    Get-Process -Id (Get-NetTCPConnection -LocalPort 443).OwningProcess
    ```

    If you do, you must stop it:

    ```text
    iisreset /stop
    ```

3. Check if you have Apache Solr or any other service running on port 8984:

    ```text
    Get-Process -Id (Get-NetTCPConnection -LocalPort 8984).OwningProcess
    ```

    If you do, you must stop it:

    ```text
    Stop-Service -Name "<the name of your service>"
    ```

    Alternatively, if you have started it with Non-Sucking Service Manager, stop it with this command:

    ```text
    nssm stop "<the name of your service>"
    ```

4. Go to your solutions folder and create the MyProject solution and project:

    ```text
    dotnet new sitecore.nextjs.gettingstarted -n MyProject
    ```

5. Go to the `MyProject` folder.
6. To prepare the Sitecore container environment, run the script `init.ps1` from the root directory of the project:

    ```text
    .\init.ps1 -InitEnv -LicenseXmlPath "<C:\path\to\license.xml>" -AdminPassword "<desired password>"
    ```

7. To download the Sitecore Docker images, install and configure the containers and JSS application, run the following script:

    ```text
    .\up.ps1
    ```

8. When prompted, in your browser, log in to Sitecore and accept the device authorization.
9. Wait for the startup script to open browser tabs for the rendered site and the Sitecore Launchpad.

## Rebuild search indexes

- If you ever run the script `\docker\clean.ps1`, you must [rebuild search indexes](https://doc.sitecore.com/xp/en/developers/104/platform-administration-and-architecture/en/rebuild-search-indexes.html).