Newer Version Available

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

Know Your Orgs for Second-Generation Managed Packages

Some of the orgs that you use with second-generation managed packaging (managed 2GP) have a unique purpose.

Choose Your Dev Hub Org

Use the Dev Hub org for these purposes.
  • As owner of all second-generation managed packages
  • To link your namespaces
  • To authorize and run your sf package Salesforce CLI commands

We recommend that your Partner Business Org is also your Dev Hub org.

The Dev Hub org against which you run the sf package create command becomes the owner of the package.

If the Dev Hub org expires or is deleted, packages owned by that Dev Hub:
  • Can’t be transferred to a different Dev Hub
  • Stop working and new package versions can’t be created

Note

Namespace Org

The primary purpose of the namespace org is to acquire a namespace for your managed 2GP package.

After you create a namespace org and specify the namespace in it, open the Dev Hub org and link the namespace org to the Dev Hub org.

Other Orgs

When you work with managed 2GP packages, you also use these orgs:
  • Scratch orgs to develop and test your packages.
  • A target or installation org in which you install the package.