Create an environment_
Create an Appwrite project environment from the Console, as an empty environment or as a copy of the project, and switch between production and its environments.
3 min read
An environment is created from its project. It lands in the project's organization and region, and it's ready to use as soon as it's created.
Open the environment switcher

- Open your project in the Appwrite Console.
- Click the environment switcher in the project sidebar, above Overview. It shows Production with a green dot.
- Click Create environment.
Environments are available on the Pro and Enterprise plans. On the Free plan, the switcher lists example environments such as Staging and Preview instead, and picking one offers to upgrade the organization to Pro.
Name the environment

- Enter a Name, such as
Staging. The Console suggests one that isn't taken yet. - Check the Environment ID. It follows the name, so
Staginggivesstaging. Apps pass this ID next to the project ID, so pick one that's easy to type. It can contain lowercase letters, numbers, and hyphens, starts with a letter or a number, and can't be changed later. Leave it blank to generate a random ID.
Choose where to start
Under Start from, choose one of:
- Empty environment. Nothing is copied. The environment starts like a new project.
- Clone of the project. The project's structure and settings are copied, and data only where you tick it. Choose what to copy under What to copy. Learn what a copy includes.

Click Create environment. The Console opens the new environment.
If you cloned the project, a card in the bottom-right corner shows the copy's progress. The environment is usable while the copy runs, and its pages refresh when the copy finishes.
Work inside an environment

Inside an environment, a purple banner at the top of every project page names the environment, and the environment switcher shows its name with a purple dot. Every page of the project, from Databases to Sites, now shows and changes the environment's resources instead of production's.
The project's Get started page shows the endpoint, project ID, and environment ID to connect an app to the environment.
Switch environments
Open the environment switcher and pick Production or another environment. The Switch to production button on the banner goes straight back to production.
The Console keeps you on the same project URL and remembers the environment you picked for each project in the current browser tab. A different tab can work in a different environment of the same project.
Create environments with a server SDK
Environments can also be created from a server SDK, with an API key created in the project that has the project.write scope. Call createEnvironment on the Project service with the environment's ID, its name, and the resource types to copy:
const sdk = require('node-appwrite');
const client = new sdk.Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') .setProject('<PROJECT_ID>') .setKey('<API_KEY>');
const project = new sdk.Project(client);
const environment = await project.createEnvironment({ environmentId: 'staging', name: 'Staging', resources: [ sdk.EnvironmentResource.Database, sdk.EnvironmentResource.Table, sdk.EnvironmentResource.Column, sdk.EnvironmentResource.Index, sdk.EnvironmentResource.Bucket, sdk.EnvironmentResource.Function, sdk.EnvironmentResource.EnvironmentVariable, ],});Leave out resources to create an empty environment. The Project service also lists environments with listEnvironments, and gets, renames, or deletes one with getEnvironment, updateEnvironment, and deleteEnvironment.
Next steps
Was this page helpful?
Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.