---
schema_version: "1"
id: d14a3ed5c9ffbdc55a169d006bd5baf3728fd39b2c3a5ce3bf8ba66e866ea9d9
title: Install the Package in a Target Org
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform-pkg-exchange/managed_packaging/guides/first-generation/build-first-gen-dx/sfdx-dev-build-man-pack-install.md
canonical_url: https://developer.salesforce.com/docs/platform/pkg1-dev/guide/sfdx-dev-build-man-pack-install.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 957302918866b88a10adc93501a712915ad7a3e02c242d25bef3ff34fe111e9e
products:
  - First-Generation Managed Packaging Developer Guide
  - merged-docs
---

# Install the Package in a Target Org

After you create a package with the CLI, install the package in a target org. You can install the package in any org you can authenticate, including a scratch org.

## Before You Begin

If you want to create a scratch org and set it as the `defaultusername` org, run this command from the project directory.

```nolang
sf org create scratch -definition-file config/project-scratch-def.json
```

To locate the ID of the package version to install, run `sf package1 version list`.

```nolang

METADATAPACKAGEVERSIONID  METADATAPACKAGEID   NAME  VERSION  RELEASESTATE  BUILDNUMBER
────────────────────────  ──────────────────  ────  ───────  ────────────  ───────────
04txx000000069oAAA        033xx00000007coAAA  r00   1.0.0    Released      1
04txx000000069tAAA        033xx00000007coAAA  r01   1.1.0    Released      1
04txx000000069uAAA        033xx00000007coAAA  r02   1.2.0    Released      1
04txx000000069yAAA        033xx00000007coAAA  r03   1.3.0    Released      1
04txx000000069zAAA        033xx00000007coAAA  r04   1.4.0    Released      1
```

You can then copy the package version ID you want to install. For example, the ID 04txx000000069zAAA is for version 1.4.0.

1.  Install the package. You supply the package alias or version ID, which starts with 04t, in the required `--package` parameter.

    ```nolang
    sf package install --package 04txx000000069zAAA
    ```

    If you’ve set a default target org, the package is installed there. You can specify a different target org with the `--target-org` parameter. If the package is protected by an installation key, supply the key with the `--installation-key` parameter.

## Next Steps

To uninstall a package, open the target org and choose **Setup**. On the Installed Packages page, locate the package and choose **Uninstall**.
