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:
Create the package – define static info such as the name and description.
Create a package version – the deployable artifact you install in any org.
Step 1: Create a Package
Hover over Salesforce DX and select Packages.
Click Create Package.
Enter a Package Name and Package Description.
Choose Package Type: Unlocked or Managed.
Select the Dev Hub that owns the package.
Choose the Version Control Repository and Branch.
Pick the Package Directory.

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:
Version Name – auto-generated from the package name (editable).
Version Description – brief summary.
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.
Installation Key – optional password to protect the package.
Tag – release label such as
Release 1.0.0.

Package Dependencies
If the Dev Hub owns other packages, they appear here.
Move items between lists with
and 
Re-order with
and 

Click View Metadata or Create Package:
View Metadata – review the metadata pulled from VCS before creating.

Create Package – create the package with the specified data.
Progress appears on the Unlocked Package home screen.


More Information on the Package Screen

Status – view success/failure and download the log.
Actions
Delete Package – permanently removes the package.
Create Version
– add a new version.
Info – hover for package metadata.
View Packaged Versions
– shows each version’s details.

Important Notes
For unlocked packages, the latest promoted version is used as the ancestor.
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.

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.

Last updated
Was this helpful?

