Create Developer Hub and Namespace Orgs

Link a Developer Hub org to a namespace org to use the Salesforce Developer Experience to develop a second-generation package.

Create an Org with Dev Hub Features Enabled 

Use this Dev Hub org to manage scratch orgs and build managed packages for distribution.

  1. Create a Developer Edition org.
  2. Turn on Dev Hub features. From Setup, enter Dev Hub in the Quick Find box and select Dev Hub. Then, click Enable. After you enable Dev Hub, you can’t disable it.
  3. Select Unlocked Packages and Second-Generation Managed Packages.

Create a Namespace Org 

Create a separate org just to manage the namespace. If you’re creating a managed package for distribution, a namespace is required.

  1. Create a Developer Edition org.
  2. Create a namespace.
  3. In the Dev Hub org, use Namespace Registry to register the namespace that you created. See Link a Namespace to a Dev Hub Org for more information.
  4. In the sfdx-project.json file, use the namespace attribute to specify your namespace.