Setting up a new Sitecore XM Cloud - Next.js project

sebasab

Sebastián Aliaga

Posted on December 7, 2023

Setting up a new Sitecore XM Cloud - Next.js project

In this blog post, we will guide you through the process of creating a new project using the Sitecore starter template, breaking down the steps for a clear understanding. Additionally, we will walk you through the setup of the local environment using Docker containers. Along the way, we'll explore some valuable tricks and highlight common mistakes that individuals often encounter when configuring this setup for the first time.

Creating a repository

  • If the repository hasn't been created yet, you can leverage the Sitecore template to effortlessly initiate a new project, complete with all the necessary files.

Starter template repository

  • After completing the initial step, clone the repository to your computer and proceed with the following steps
    • Open PowerShell with administrator privileges.
    • Navigate to the project directory.

It's important to already have a Sitecore license in your computer.

  • Make sure you're running docker on Windows Container and not Linux Containers.
  • Stop any Solr instances.
  • Stop the IIS

    • Perform the first command (you can find this also in the README.md that comes with the project when creating the repo).

Before running the init command

  • Make sure about the path of your license and select a secure password for your environment

    • After succesfully completing the previous step you'll see something like this on your terminal:

After running the init command

  • "It is crucial to restart your terminal at this point; failure to do so may result in errors during the subsequent steps.
  • Execute the ./up.ps1 command; this will initiate the download of all the necessary files and images required for the containers.

Running the up command, downloading dependencies and images for docker containers

  • If everything went right, and after login with your Sitecore Portal account, you should see something like this:

After succesfully running the up command

  • Finally, for the last step, create a .env.local file within the project folder and populate the necessary fields, including:
    • SITECORE_API_KEY
    • GRAPH_QL_ENDPOINT Ensure the values are aligned with those configured on the cloud instance of your project.
💖 💪 🙅 🚩
sebasab
Sebastián Aliaga

Posted on December 7, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related