Configuring multiple servers

Warning: contentstack-express framework has been deprecated. We will soon stop supporting this framework. Instead, we recommend using DataSync, which is faster and more flexible than the web framework.

To enable horizontal scaling of content, you can add multiple servers for any environment and set up an internal process to connect each server.

Add multiple servers within the environment

First, you need to add your servers in the environment. To do so, you can either add a new environment or update an existing one.

Now, on the configuration window, click on the Advanced option of the environment. Under the Deploy Content to Server(s) section, add the names of servers that you wish to add for this environment.


Finally, after adding the servers in an environment, you need to run your app on the servers.

Start the app in individual servers

To start your app on all the servers, run the following command in all of them, along with the corresponding server details.

For Windows:

set NODE_ENV=<<YOUR_ENV_NAME>>&& set SERVER=<<YOUR_SERVER_NAME>>&& npm run start

To run ‘Server 1’ and ‘Server 2’ in Windows, run the following commands in the respective servers:

  • Server 1:
  • set NODE_ENV=production&& set SERVER=Server 1&& npm run start
  • Server 2:
  • set NODE_ENV=production&& set SERVER=Server 2&& npm run start

For Linux:


To run ‘Server 1’ and ‘Server 2’ in Linux, run the following commands in the respective servers:

  • Server 1:
  • NODE_ENV=production SERVER=Server 1 npm run start
  • Server 2:
  • NODE_ENV=production SERVER=Server 2 npm run start

Publish content in the environment

Once you perform the above steps, publish the entries in the environment. The published content will reflect in all the servers.

Was this article helpful?

Thanks for your feedbackSmile-icon

More articles in "Advanced Topics"

On This Page