---
schema_version: "1"
id: 92d265840d76a3da070717fc9b1565d3f3ea206020d54d4daa6b7d7bee5645da
title: Know Your Orgs for Second-Generation Managed Packages
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform-pkg-exchange/managed_packaging/guides/second-generation/sfdx-dev-dev2gp-before-know-orgs.md
canonical_url: https://developer.salesforce.com/docs/platform/pkg2-dev/guide/sfdx-dev-dev2gp-before-know-orgs.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d760a59e4a3c40fcca83ae0a48677471e4c7d797e5ab624ce25b9f611e3a33ea
products:
  - Second-Generation Managed Packaging Developer Guide
  - merged-docs
---

# 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](https://developer.salesforce.com/docs/platform/pkg2-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)
