---
title: "Connect SitecoreAI Page builder to your local XM instance"
slug: "connect-sitecoreai-page-builder-to-your-local-xm-instance"
abstract: "Enable SitecoreAI Page builder to use your locally running rendering host and XM instance."
---
# Connect SitecoreAI Page builder to your local CM instance

When you use Docker for full-stack development in [SitecoreAI](https://doc.sitecore.com/sai/en/users/sitecoreai/sitecoreai.html), and after you set up your local development environment, the Page builder is not connected to your locally running instance.

Setting a local storage key in your browser lets you connect your local application to the Page builder.

> [!note]
> **Before you begin**
> -   You must [join the Sitecore Cloud Portal organization where your instance was created](https://doc.sitecore.com/sai/en/developers/sitecoreai/user-security/users-roles-and-domains/creating-users-in-sitecoreai.html "Creating users in SitecoreAI") and have access to the SitecoreAI app.
>
> -   You must start your SitecoreAI container.
>
> -   The rendering application must be run in connected mode.
>
> -   If you upgraded your JSS SDK to 22.1 or higher, complete the steps to [optimize performance for metadata-based integration](https://doc.sitecore.com/sai/en/developers/jss/22/jss-sai/optimize-performance-for-metadata-based-integration.html).

To connect the Page builder:

1. In your browser, navigate to the SitecoreAI Page builder application.
2. Open the developer tools console of your browser and find the local storage section. The location differs between browsers:
    - For Chrome and Edge, open the **Application** panel. In the **Storage** section, expand the **Local Storage** section.
    - For Firefox, open the **Storage** panel, and expand the **Local Storage** section.
3. In the **Local Storage** panel, click the entry `https://pages.sitecorecloud.io` to reveal the local storage entries.
4. Create a new entry by adding a new row with the following values:
    - Key: `Sitecore.Pages.LocalXmCloudUrl`.
    - Value: the URL of your local instance. For example, `https://xmcloudcm.localhost/`.
5. Verify that your local instance is configured to connect with the Page builder. If correctly configured, your instance has the following environment variables:

    ```plaintext
    SITECORE_Pages_Client_Host=https://pages.sitecorecloud.io
    SITECORE_Pages_CORS_Allowed_Origins=pages.sitecorecloud.io
    SITECORE_GRAPHQL_CORS=\*.sitecorecloud.io
    ```

6. In Docker, add the environment variables to the `docker-compose.override.yml` file, specifically within the `environment` section of the `cm` service. This ensures that the container recognizes the variables correctly.
7. Refresh the https://pages.sitecorecloud.io page to see your local front-end application.

    > [!note]
    > If you get a *401* error, click Home![home.png](https://doc.sitecore.com/api/markdown-image/sai/en/developers/sitecoreai/images/home.png) and log in again if prompted.
