---
title: "Walkthrough: Creating a JSS Next.js application with the JSS CLI"
slug: "walkthrough--creating-a-jss-next-js-application-with-the-jss-cli"
abstract: "Get started with developing code-first JSS Next.js apps"
---
# Walkthrough: Creating a JSS Next.js application with the JSS CLI

If you are a front-end/JavaScript developer you can scaffold a JSS Next.js app quickly with the JSS CLI command `jss create`.

The resulting project is optimized for [code-first development](https://doc.sitecore.com/xp/en/developers/hd/19/sitecore-headless-development/code-first-development-workflow.html "Code-first development workflow"). If you do not have a Sitecore instance or do not plan to develop against it, you can [work disconnected from Sitecore](https://doc.sitecore.com/xp/en/developers/hd/19/sitecore-headless-development/working-disconnected-in-jss.html "Working disconnected in JSS").

You can create a JSS Next.js application by using the JSS command-line tool (CLI).

> [!note]
> If you use this approach, you must perform [additional steps to connect to a Sitecore instance](https://doc.sitecore.com/xp/en/developers/hd/19/sitecore-headless-development/walkthrough--connecting-a-code-first-jss-next-js-application-to-sitecore.html "Walkthrough: Connecting a code-first JSS Next.js application to Sitecore").
>
> To ensure that your new JSS application is compatible with your licensed Sitecore XP version, consult [the Sitecore compatibility table](https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0541788).

We recommend this approach for Sitecore developers who use the code-first development workflow or wish to evaluate the JSS developer experience without installing Sitecore.

Before you can create JSS applications using the JSS CLI, you must [install the JSS CLI globally](https://doc.sitecore.com/xp/en/developers/hd/19/sitecore-headless-development/install-the-jss-cli-globally.html "Install the JSS CLI globally").

This walkthrough describes how to:

- Create a JSS Next.js application.
- Run the JSS Next.js application.
- Steps after app creation.

## Create a JSS Next.js application

To create a JSS application based on the Next.js template:

- In a terminal, run the following command, providing the name of the directory and the `nextjs` template:

    ```text
    jss create my-first-jss-app nextjs [--fetchWith {REST|GraphQL}] [--prerender {SSG|SSR}]
    ```

The command creates the JSS Next.js application for the latest version of JSS and installs the necessary packages.

> [!tip]
> To create an application using a previous version of JSS, see an example in the [JSS CLI reference for `jss create`](https://doc.sitecore.com/xp/en/developers/hd/19/sitecore-headless-development/sitecore-javascript-rendering-sdk-cli-tools-api-reference.html#UUID-ba8bae12-5938-63d2-1ae1-451aec88abe5_UUID-63ee54c7-6c40-bc5a-0db9-0be674e71aa0 "jss create").

## Run the JSS Next.js application

To run your application:

1. In the terminal, go to your application directory. For example:

    ```text
    cd my-first-jss-app
    ```

2. In the terminal, run the command:

    ```text
    jss start
    ```

You can now start [developing in disconnected mode](https://doc.sitecore.com/xp/en/developers/hd/19/sitecore-headless-development/working-disconnected-in-jss.html "Working disconnected in JSS").

## Integrate your app with Sitecore

Activities such as deploying your code-first artifacts and content to Sitecore, WYSIWYG editing, and using JSS in a production environment require a Sitecore instance.

To deploy your code-first artifacts and content to Sitecore, [connect your JSS app to Sitecore](https://doc.sitecore.com/xp/en/developers/hd/19/sitecore-headless-development/walkthrough--connecting-a-code-first-jss-next-js-application-to-sitecore.html "Walkthrough: Connecting a code-first JSS Next.js application to Sitecore") and [connect to an advanced Sitecore editor](https://doc.sitecore.com/xp/en/developers/hd/19/sitecore-headless-development/walkthrough--connecting-a-next-js-jss-app-to-sitecore-editors.html "Walkthrough: Connecting a Next.js JSS app to Sitecore editors").

If you want to, you can also [switch from the code-first to the Sitecore-first development workflow](https://doc.sitecore.com/xp/en/developers/hd/19/sitecore-headless-development/transitioning-from-code-first-to-sitecore-first.html "Transitioning from code-first to Sitecore-first").