# 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. For important considerations about your Dev Hub org, see [Enable Dev Hub and Second-Generation Managed Packaging](/docs/platform/pkg1-dev/guide/sfdx-pkg-enable-devhub.md).

:::note
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
:::

## 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.

**See Also**

- [Link a Namespace to a Dev Hub Org](https://developer.salesforce.com/docs/atlas.en-us.pkg2\_dev.meta/pkg2\_dev/sfdx_dev_reg_namespace.htm)
- [Scratch Org Allocations for Partners](https://developer.salesforce.com/docs/atlas.en-us.pkg2\_dev.meta/pkg2\_dev/isv_partner_scratch_org_allocations.htm)
- [*Salesforce DX Developer Guide:* Scratch Orgs](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs.htm)
