Scratch orgs offer a temporary evaluation environment with a maximum duration of 30 days.
- Install Salesforce CLI. See Salesforce CLI Setup Guide: Install Salesforce CLI.
-
Enable Dev Hub in an org. If you don't already have a Dev Hub org with larger scratch org allocations, you can use a Developer Edition (DE) org, which provides a maximum of 3 active scratch orgs. See Salesforce DX Developer Guide: Enable Dev Hub Features in Your Org.
Note If you already use scratch orgs and have Salesforce CLI installed, skip to the information about the scratch org definition file.
- Access Lifecycle Center in the Dev Hub org. You can disable Lifecycle Center after your evaluation.
- Create an empty Salesforce DX project if you don't have an existing source control repository. See Salesforce DX Developer Guide: Create a Salesforce DX Project.
-
Update the scratch org definition file,
sfdx-project.json, to enable Lifecycle Center.
If creating a scratch org based on an org shape, you still must include the Lifecycle Center feature and setting in the scratch org definition file for legal reasons as part of the Lifecycle Center terms and conditions.{ "orgName": "Acme", "edition": "Enterprise", "features": ["DevOpsCenter"], "settings": { "devHubSettings": { "enableALMDevopsCorePref": true } } }{ "orgName": "Acme", "sourceOrg": "00DB1230400Ifx5", "features": ["DevOpsCenter"], "settings": { "devHubSettings": { "enableALMDevopsCorePref": true } } } -
Log in to the Dev Hub org using Salesforce CLI. In this example, the Dev Hub org is given the alias
MyDevHub.sf org login web -a MyDevHub -
Create a scratch org using the updated definition file. In this example, the scratch org is created with the alias
devops-center-scratch, with a duration of 30 days, using the Dev Hub org with the aliasMyDevHub.sf org create scratch -a devops-center-scratch -f config/project-scratch-def.json -v MyDevHub -d 30 - Enable Lifecycle Center in the new scratch org, then complete your configuration.