Andrew Hanna

Andrew Hanna

Dev Hub in Salesforce: The Org Decision You Can't Undo

Dev Hub in Salesforce: The Org Decision You Can't Undo

TL;DR: The Dev Hub is the Salesforce org that creates and manages your scratch orgs, unlocked packages and second-generation managed packages. You enable it in Setup on a production, Developer Edition or trial org, never a sandbox, and once it is on you cannot turn it off. For any team that ships, choosing the Dev Hub org is an architecture decision, not a checkbox.

What is a Dev Hub in Salesforce?

The Dev Hub is the control org behind source-driven development. It is where your scratch orgs, packages and namespaces are managed, and every scratch org you create stays linked to it until it expires. No Dev Hub means no scratch orgs and no second-generation packaging.

Trailhead's Salesforce DX setup module puts it simply: a Dev Hub gives your team the ability to create and manage scratch orgs. What the setup guides rarely say is how much rides on which org you pick.

Which org should be your Dev Hub?

Most guides stop at "click Enable". Our view: for a team that ships, the Dev Hub belongs in your production org, or in your partner business org if you are an AppExchange partner. Three reasons:

  • Limits. Scratch org allocations follow the edition of the Dev Hub org, and a Developer Edition hub caps you at three active scratch orgs.
  • Permanence. After you enable Dev Hub you cannot disable it, and your packages and namespaces are managed from it. A Developer Edition org that one engineer signed up for is a fragile home for your package history.
  • Safety. Salesforce states that enabling Dev Hub in a production or business org does not cause performance or customer issues.

A Developer Edition org or Trailhead Playground is the right place to learn. Trailhead itself recommends practising somewhere other than production. Just do not let the practice hub quietly become the team hub.

How many scratch orgs can a Dev Hub create?

Salesforce publishes scratch org allocations by Dev Hub edition:

  • Developer Edition or trial: 3 active, 6 per day.
  • Enterprise Edition: 40 active, 80 per day.
  • Unlimited and Performance Editions: 100 active, 200 per day.

The daily figure counts successful creations in a rolling 24-hour window. The active figure frees up when a scratch org is deleted or expires. A CI pipeline that spins up a fresh scratch org per pull request exhausts a Developer Edition allocation in a morning, which is why Salesforce recommends a production or business org for package versions and CI jobs. Check your headroom with sf org list limits --target-org DevHub and look for ActiveScratchOrgs and DailyScratchOrgs.

How do you enable and connect a Dev Hub?

  1. Log in as a System Administrator to the org you chose.
  2. In Setup, search Quick Find for Dev Hub and enable it. Remember this step is permanent.
  3. Authorize it from the Salesforce CLI: sf org login web --set-default-dev-hub --alias DevHub.
  4. Give developers access. For people who only need the Dev Hub, Salesforce offers the Salesforce Limited Access - Free license by request through your account executive, paired with a permission set that grants Scratch Org Info (read, create, delete) and Active Scratch Org (read, delete).
  5. Create a scratch org from your project definition: sf org create scratch --definition-file config/project-scratch-def.json --alias feature-x --duration-days 7.

Two details catch teams out. The Limited Access - Free license does not support Org Shape or Scratch Org Snapshots, which need a standard Salesforce user license. And scratch orgs expire after 7 days by default, with a 30-day maximum, so long-running feature work needs a plan to recreate them.

Why do scratch orgs still fail you in testing?

This is the gap the Dev Hub guides leave open. A fresh scratch org has your metadata and none of your data. Tests pass against empty orgs, then the same change fails in UAT because a Flow meets a record shape it has never seen. It is one of the hidden risks in your Salesforce deployment process, and a big part of why Salesforce deployments still break.

Serpent closes it at environment setup. Sandbox seeding loads sample or masked data as part of environment setup and release pipelines, so scratch orgs and refreshed sandboxes come back populated without a manual script run. PII masking obfuscates common personal fields during preview and migration, which keeps production-shaped data usable in lower environments while meeting GDPR and similar rules. The full steps are in our data migration and masking guide.

How do DevOps tools work with the Dev Hub?

Most tools treat the Dev Hub as one more connected org. Gearset, for example, adds a Dev Hub as a normal org connection and creates scratch orgs from it, and AutoRABIT documents a scratch org creation flow in its ARM product. Creating the org is the easy part. The real question is what lands in it afterwards.

In Serpent, metadata and data move in the same release flow, and Migrate Data is an action in the visual automation flow builder. That matters beyond developers: admins who build declaratively get the same populated, disposable environments, which is the point we made in Salesforce DevOps is not just for developers.

Deploy data is listed on every plan of Serpent, including the free Essentials plan. Compare Serpent plans and seed your next scratch org with data instead of an empty shell.

FAQ

Can I enable Dev Hub in a sandbox?

No. Dev Hub can only be enabled in a production, business, Developer Edition or trial org.

Can I disable Dev Hub after enabling it?

No. Enabling Dev Hub is permanent, so choose the org deliberately before you switch it on.

Is it safe to enable Dev Hub in production?

Salesforce states it does not cause performance or customer issues, and production gives you far higher scratch org limits than a Developer Edition org.

How long does a scratch org last?

Seven days by default. You can set a duration of up to 30 days when you create it.

Related Articles

Curious about faster shipping before you dive in? Let's talk

Commitment free!