---
title: "Configure EXM in a scaled environment"
slug: "configure-exm-in-a-scaled-environment"
abstract: "How to configure EXM to work in a scaled environment including how to configure your Content Delivery and Content Management servers either manually or using scripts."
---
# Configure EXM in a scaled environment

If you are working with Sitecore in a scaled environment, you must configure the Email Experience Manager (EXM) to work in this environment either manually or [using scripts](https://doc.sitecore.com/xp/en/developers/exm/91/email-experience-manager/configure-a-dedicated-email-dispatch-server-on-prem.html "Configure a dedicated email dispatch server on-prem").

A scaled environment usually consists of one Content Management (CM) server and one or more Content Delivery (CD) servers. You can configure servers for a specific purpose (for example, content management, content delivery, or processing) using a rule-based configuration.

In the standard multiserver Sitecore environment, all content management and content delivery instances share the Core and Web databases and all the CM server instances share the Master database. This means that the same connection strings to the databases must be used in the configuration file of each server.

The following diagram illustrates the connections between the servers and the content databases in a standard multiserver Sitecore setup:

![Diagram of the connection types for databases and servers.](<https://doc.sitecore.com/api/markdown-image/xp/en/developers/exm/91/email-experience-manager/images/Config%20EXM%20scaled%20envt%2034%20and%2090+.png>)

Email campaigns are dispatched from each dedicated dispatch server (DDS) and, optionally, from the primary CM server. 

<details>
<summary><h2>Configure a content management server</h2></summary>

To configure a content management server:

1. Install Sitecore Experience Platform and configure it according to the [Sitecore scaling recommendations for content management servers](https://doc.sitecore.com/xp/en/developers/91/platform-administration-and-architecture/content-management--cm-.html).
2. On the primary CM server, in the `\App_Config\ConnectionStrings.config` file, add the `EXM.DedicatedDispatchService` connection string, for example:

    ```text
    <add name="EXM.DedicatedDispatchService" connectionString="/sitecore%20modules/web/exm/dedicateddispatchservice.asmx" />
    ```

3. On all the content management servers in your scaled environment, in the `\App_Config\ConnectionStrings.config` file, add the `EXM.InternalApiKey` connection string, for example:

    ```text
    <add name="EXM.InternalApiKey" connectionString="0x0000000000000000000000000000000000000000000000000000000000000000" />
    ```

    > [!warning]
    > The connection string must be a 64-character hexadecimal. The connection string value in the previous code is just an example, and not intended for use.

    > [!note]
    > EXM uses the *InternalAPIKey* internally to validate requests to DDS servers.

4. On all of the content management servers in your scaled environment *that are not your primary one*, create a patch file that disables Scheduled Tasks processing. To do this, use the following code snippet:

    ```text
    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">  <sitecore>    <scheduling>            <agent name="Core_Database_Agent">        <patch:delete />      </agent>            <agent name="Master_Database_Agent">        <patch:delete />      </agent>    </scheduling>  </sitecore></configuration>
    ```

In a scaled setup, you must manually copy any HTML files that you want to use as templates for your email campaigns to the `Website/sitecore modules/Web/EXM/layouts/Imported` folder on all the CM servers and dedicated dispatch servers that you have configured to dispatch email campaigns.

</details>

<details>
<summary><h2>Configure a content delivery server</h2></summary>

To configure a content delivery server:

1. Install Sitecore Experience Platform and configure it according to the Sitecore scaling recommendations for [content delivery servers](https://doc.sitecore.com/xp/en/developers/91/platform-administration-and-architecture/content-delivery--cd-.html).
2. In the `/App_Config/ConnectionStrings.config` file, add the `EXM.CryptographicKey` and `EXM.AuthenticationKey` connection strings.

    ```xml
    <add name="EXM.CryptographicKey" connectionString=
    "E040C938FC9E4EBC3E93330B0F7837F284207B8180DB64CB5B6ABEB1AFBF6F5B" />
    <add name="EXM.AuthenticationKey" connectionString=
    "9D80B4E56AEE694058567BD89C936FB88F2DB1272A4E88F419B6501919E0BB25" />
    ```

    > [!note]
    > Each key must be a hexadecimal 64-character string (with symbols 0-9 and A-F) and must be the same across all servers. The *CryptographicKey* and *AuthenticationKey* are used to encrypt/decrypt data. For example:

    > [!note]
    > For security reasons, do not use the example key provided in the example.

</details>