---
schema_version: "1"
id: 4a2004e9fd02b3d9b156c3c62e44b4e59edb44e63423c8f99edd207ccd5d8dc3
title: Best Practices 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-plan-best-practices.md
canonical_url: https://developer.salesforce.com/docs/platform/pkg2-dev/guide/sfdx-dev-dev2gp-plan-best-practices.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 31a43b36c069f6e728c1d4540e186e13ef3b9c5bfa52f4109487397de4bb84a6
products:
  - Second-Generation Managed Packaging Developer Guide
  - merged-docs
---

# Best Practices for Second-Generation Managed Packages

We suggest that you follow these best practices when working with second-generation managed packages.

- We recommend that you work with only one Dev Hub, and enable Dev Hub in your partner business 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 associated with a package expires or is deleted, its packages no longer work.
- Include the `--tag` option when you use the `sf package version create` and `sf package version update` commands. This option helps you keep your version control system tags in sync with specific package versions.
- Create user-friendly aliases for packaging IDs, and include those aliases in your Salesforce DX project file and when running CLI packaging commands. See: [Package IDs and Aliases for Second-Generation Managed Packages](https://developer.salesforce.com/docs/platform/pkg2-dev/guide/sfdx-dev-dev2gp-plan-pkg-types-pkg-ids.md).
- When adding components to your package, check the product documentation for that component to ensure that the product is generally available (GA). If you choose to package a non-GA component, it may have limitations and isn't guaranteed to GA. This scenario is particularly risky if the component can't be removed from a managed package.
