Newer Version Available

This content describes an older version of this product. View Latest

Scratch Orgs

The scratch org is a source-driven and disposable deployment of Salesforce code and metadata. A scratch org is fully configurable, allowing developers to emulate different Salesforce editions with different features and preferences. You can share the scratch org configuration file with other team members, so you all have the same basic org in which to do your development.
Available in: Salesforce Classic and Lightning Experience
Dev Hub available in: Enterprise, Performance, and Unlimited Editions
Scratch orgs available in: Developer, Enterprise, Group, and Professional Editions

Scratch orgs drive developer productivity and collaboration during the development process, and facilitate automated testing and continuous integration. You can use the CLI or IDE to open your scratch org in a browser without logging in. You might spin up a new scratch org when you want to:

  • Start a new project.
  • Start a new feature branch.
  • Test a new feature.
  • Start automated testing.
  • Perform development tasks directly in an org.
  • Start from “scratch” with a fresh new org.

Partners can create partner edition scratch orgs: Partner Developer, Partner Enterprise, Partner Group, and Partner Professional. This feature is available only if creating scratch orgs from a Dev Hub in a partner business org. See Supported Scratch Org Editions for Partners in the ISVforce Guide for details.

Note

Scratch Orgs Created in Government Cloud or Public Cloud

The Dev Hub org instance determines where scratch orgs are created.

  • Scratch orgs created from a Dev Hub org in Government Cloud are created in a Government Cloud instance.
  • Scratch orgs created from a Dev Hub org in Public Cloud are created on a Public Cloud instance.

Scratch Org Allocations and Considerations

To ensure optimal performance when you’re using Salesforce DX, your Dev Hub org edition determines your scratch org allocations. These allocations determine how many scratch orgs you can create daily, and how many can be active at a given point. By default, Salesforce deletes scratch orgs and their associated ActiveScratchOrg records from your Dev Hub org when a scratch org expires. A scratch org expires in 7 days unless you set a duration when you create it.

Scratch orgs have these storage limits:
  • 200 MB for data
  • 50 MB for files
Edition Active Scratch Org Allocation Daily Scratch Org Allocation
Enterprise Edition 40 80
Unlimited Edition 100 200
Performance Edition 100 200
Dev Hub trial 20 40

If you are a partner or ISV, your scratch org allocations might be different. See the ISVforce Guide for details.

Note

To try out Salesforce DX, sign up for a Dev Hub trial org. Trial Dev Hubs expire after 30 days, and each trial Dev Hub gets 10 user licenses.

List Active and Daily Scratch Orgs

To view how many scratch orgs you have allocated, and how many you have remaining: