Create an Unlocked/Managed Package

What’s a Package?

A package is a container of related metadata—features, customizations, and schema—that you move from one Salesforce org to another.

There are two kinds:

  • Unlocked packages – ideal for internal development; they let you add, edit, and remove metadata across multiple orgs in a traceable way.

  • Managed packages – created by Salesforce partners to distribute or sell apps. They bundle code and configuration into a single, versioned unit.


Create a Package

Creating a package involves two steps:

  1. Create the package – define static info such as the name and description.

  2. Create a package version – the deployable artifact you install in any org.


Step 1: Create a Package

  1. Hover over Salesforce DX and select Packages.

  2. Click Create Package.

  3. Enter a Package Name and Package Description.

  4. Choose Package Type: Unlocked or Managed.

  5. Select the Dev Hub that owns the package.

  6. Choose the Version Control Repository and Branch.

  7. Pick the Package Directory.

Create Package form fields

Step 2: Create a Package Version

A package version is an immutable snapshot of the metadata in your package. You can install it in scratch orgs, sandboxes, or production.

Fill in the Package Version section:

  1. Version Name – auto-generated from the package name (editable).

  2. Version Description – brief summary.

  3. Version Number – format major.minor.patch.build (e.g., 1.2.3.4).

    The version must contain four dot-separated numbers. Any other format causes an error.

  4. Installation Key – optional password to protect the package.

  5. Tag – release label such as Release 1.0.0.

Package Version details

Package Dependencies

If the Dev Hub owns other packages, they appear here.

  • Move items between lists with

    • and

  • Re-order with

    • and

Package Dependencies list

Click View Metadata or Create Package:

  • View Metadata – review the metadata pulled from VCS before creating.

    View Metadata list
  • Create Package – create the package with the specified data.

Progress appears on the Unlocked Package home screen.

Package home progress
Package progress details

More Information on the Package Screen

Package management screen
  1. Status – view success/failure and download the log.

  2. Actions

    • Delete Package – permanently removes the package.

    • Create Version – add a new version.

  3. Info – hover for package metadata.

View Packaged Versions – shows each version’s details.

Packaged version details

Important Notes

  1. For unlocked packages, the latest promoted version is used as the ancestor.

  2. For managed packages:

    • If no ancestor chosen, the latest promoted version is selected.

    • Selecting None creates a version without an ancestor.

    • To choose a non-latest ancestor, tick Skip Ancestor Check.

    Skip ancestor check option
  3. Non-linear versioning in the same branch is restricted.


Promote

Promote a package version to make it installable outside scratch orgs. You may promote only once per version number.

  • Code coverage must be ≥ 75 % for promotion.

  • Older versions created before code-coverage checks show 0 % but remain unaffected.


Package Info Tooltip

Hover the info icon to see author, timestamps, and last-modified details.

Package information tooltip

Last updated

Was this helpful?