Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Build and Release Your App with Managed Packages

If you developed and tested your app, you’re well on your way to releasing it. Luckily, when it’s time to build and release an app as a managed package, you’ve got options. You can package an app you developed from scratch. If you’re experimenting, you can also build a sample app from Salesforce and emulate the release process.
Working with a package is an iterative process. You typically retrieve, convert, and deploy source multiple times as you create scratch orgs, test, and update the package components.
Chances are, you already have a namespace and package defined in your packaging org. If not, run this command to open the packaging org in your browser.
1sf org open --target-org me@my.org --path lightning/setup/Package/home

In the Salesforce UI, you can define a namespace and a package. Each packaging org can have a single managed package and one namespace.