Overview
Duplicates an existing environment in Dokploy with optional service selection. Creates a new environment with the same configuration and optionally the same services.This tool duplicates environments, not projects. The source and target are environment IDs.
Annotations
This operation creates a new resource and is non-destructive.
This operation is not idempotent - calling it multiple times will create multiple environments.
This operation interacts with the external Dokploy API.
Input Schema
The ID of the source environment to duplicate. Must be a valid existing environment ID.
The name for the new duplicated environment. Must be at least 1 character long.
An optional description for the duplicated environment.
Whether to include services in the duplication. Defaults to true.
Array of specific services to include. When
includeServices is true and this is not provided, you MUST first retrieve all services from the source environment and include ALL of them in this array. Services are not automatically included - you must explicitly list each service with its ID and type.Each service object should contain:id(string): The ID of the servicetype(string): The type of the service (application, postgres, mariadb, mongo, mysql, redis, compose)
Whether to duplicate the environment within the same project. Defaults to false.
Response Schema
Returns the newly created environment object:Unique identifier for the newly created environment
Name of the duplicated environment
Description of the environment
ID of the project containing this environment
ISO 8601 timestamp of when the environment was created
Object containing all duplicated services (applications, databases, compose services)
Usage Example
Error Handling
If the environment duplication fails, an error response will be returned:Notes
- This operation duplicates environments, not entire projects
- When
includeServicesis true, you must explicitly provide the list of services to duplicate - Services are not automatically included - retrieve them first using
project-oneand build theselectedServicesarray - Each service in
selectedServicesmust have bothidandtypeproperties - Supported service types:
application,postgres,mariadb,mongo,mysql,redis,compose - Use
duplicateInSameProject: trueto create the duplicate in the same project as the source - The new environment will have the same configuration as the source but with a new ID and name