ContentCon is happening live!

ContentCon is here!
Join us virtually

Add an Environment

An environment refers to the content delivery destination where you publish and deploy the entries of your application or website.

Note: When working within branches, any environment created within a branch will be available across all the other branches of the stack. Refer to our Global Modules document for more information.

To add an environment, log in to your Contentstack account, and perform the following steps:

  1. Go to your stack, navigate to the “Settings” icon (press “S”) on the left navigation panel, and select Environments (or press “alt + E” for Windows; press “option + E” for Mac OS).
  2. Click on + New Environment.
  3. The Create Environment form appears for you to add the following details:
    • Name: Enter a name for the environment, such as “staging,” “production,” “development,” and so on.
    • Environment Color: Select a color representation for your environment from the color picker.
    • Base URL: It is the consistent part of the destination’s web address (for example, http://localhost:4000, where the content will be published. The base URL is used as a prefix when the URL of an entry is generated. It is important to note that base URL would be different if using different languages (for example,

      Tip: If you wish to preview your published content, you need to provide the address of your localhost as the base URL of the environment, i.e., http://localhost:4000. Now, after publishing your content, point your browser to 'http://localhost:4000/{relative-url-of-the-published-entry}' in order to view the published content on your browser. Alternatively, you can click on the "eye" icon in the URL field of your entry page to get the URL.

      In case of mobile apps or other devices, you need not enter the base URL. This is because apps fetch content directly from Contentstack servers through APIs.

    • Advanced (optional) - The Advanced option lets you add advanced settings to your environment by providing the Deploy Content to Server(s) checkbox. When you select this option, every time you publish an item to the corresponding environment, Contentstack saves a copy in the local web server.

      Subsequently, whenever an incoming page request is received, the content will be retrieved and rendered directly from the local server, instead of fetching it from the Contentstack database via APIs. This process is also known as “push publishing.”

      It is recommended that you select this option only if you are using our web framework (contentstack-express) for your websites.

      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.

      For apps, unlike web pages, the content is not pushed to any external servers. Instead, the app fetches content directly using Content Delivery API. Therefore, there is no need to deploy content to servers. In this case, disabling the Deploy Content to Server(s) option will let you publish the entry over an environment without deploying the content on the server.

  4. Finally click Add.

Tutorial Video

In this short video, we will create a development environment with base URL as http://localhost:4000.

Preview your Entry

Hover on the Preview (eyeball) icon beside the URL field to view the URLs of all the environments in which the entry has been published. Click any of the links to visit the web page and view the entry.


API Reference

To perform the add action via API request, refer to the Add an environment API request

Was this article helpful?

Thanks for your feedbackSmile-icon

On This Page