Skip to main content

Configure Multiple Environments Using Git

This guide shows you how to set up multiple instances in Appsmith using Git, making application development easier. With Multi-instance:

  • You can work in an isolated environment, ensuring that any changes made in one instance do not affect the other instance.
  • Configure each instance with different datasource settings to streamline development according to varied needs.
  • You can collaborate within instances, allowing different teams to access specific instances; for example, QA teams can use the staging instance for their tasks.

Prerequisites

  • Two separate self-hosted instances in different environments: one for Staging and the other for Production. Refer to the Appsmith installation guides for detailed instructions on setting up your Appsmith instance.
  • Basic knowledge of Git.
Image

Setup instances

Follow these steps to set up multiple instances for your app:

  1. Create an app within the Staging instance or connect an existing app to a Git repository. Once connected, create and check out a staging branch from the default master branch.

  2. In the Staging instance, configure the datasource using the staging database configuration, then Commit and push the changes.

  3. In the Staging instance, open Git settings and:

  • Protect the staging and master branches.
  • Set the staging branch as the default.

For more information see Default Branch and Branch Protection.

  1. In the Production instance, click on the Create New button, select Import from Git and import the same app used in the Staging instance.

  2. Once the import is complete, configure the datasource by using the production database configuration in the Reconnect Datasources modal.

  3. In the Production instance:

  • Protect the master branch.
  • Set the master branch as the default.
  1. After setting up both instances, share the app by inviting users and developers. You can assign different roles to each developer or create custom roles based on your needs.

For more information, see Roles.

  1. To manage your instances, follow this branching strategy.

See also