---
schema_version: "1"
id: 42632e2410891dbec30f1dfd70c4540a75ed0e9c9110f8c1c81cfa0230ad9f41
title: Create a Second-Generation Managed Package
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-create-pkg-base.md
canonical_url: https://developer.salesforce.com/docs/platform/pkg2-dev/guide/sfdx-dev-dev2gp-create-pkg-base.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a33d1855e77709723205408d109b072627c2be36b6c28ef0ff0d426684bbe4f8
products:
  - Second-Generation Managed Packaging Developer Guide
  - merged-docs
---

# Create a Second-Generation Managed Package

A package is a top-level container that holds important details about the app or package: the package name, description, and associated namespace. When you’re ready to test or share your package, use the `sf package create` Salesforce CLI command to create a package.

To create a package, change to the project directory in the CLI. The package name you enter becomes the package alias, and is automatically added to the project file. You can choose to designate an active Dev Hub org user to receive email notifications for Apex gacks, and install, upgrade, or uninstall failures associated with your packages. For definitions of each parameter shown here, see [sf package create](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_package_commands_unified.htm#cli_reference_package_create_unified) in the Salesforce CLI Reference Guide.

```nolang
sf package create --name "Expenser App" --package-type Managed \
--path "expenser-main" --target-dev-hub my-hub --error-notification-username \
me@devhub.org
```

The package details you supply when you create a package are automatically added to your `sfdx-project.json` [project configuration file](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev2gp_config_file.htm).

## Metadata Limits in Second-Generation Managed Packages

| Metadata in package      | Limit        |
| ------------------------ | ------------ |
| Number of Metadata Files | 10,000 files |
| Total Metadata File Size | 600 MB       |

## Update Details about a Package

To update the name or description of an existing package, use this command.

```nolang
sf package update --package "Expense App" --name "Expense Manager App" \
--description "The Winter ’21 release is packed with an exciting set of features." \
--error-notification-username me2@devhub.org
```

**note:** You can’t change the package namespace or package type after you create the package.

After you promote at least one package version to the released state, you can also use the `sf package update` CLI command to recommend a specific version of the package to your subscribers. See [Recommend a Specific Package Version to Your Subscribers](https://developer.salesforce.com/docs/platform/pkg2-dev/guide/sfdx-dev-dev2gp-recommended-version.md) for more information.
