Create a Composer Repository
To install or publish Composer packages, you must create a Composer repository. Check out Nexus Repository Management and Repository Types to learn more.
Composer Proxy Repository
Use Nexus proxy repository when you want to download packages and centralize package caching of external dependencies. To learn more, check Proxy Repositories.
To create a Composer proxy repository, take the following steps:
Navigate to Settings → Repository → Repositories.
Select Create repository.
From the list of recipes, select composer (proxy).
In the form that appears, complete the required fields.
Repository Name, for example composer-proxy
Remote storage URL, for example https://packagist.org/
Blob store
Complete the additional fields for configurations you wish to add for creating your repository. Available configurations differ by repository format and type. See Configurable Repository Fields for more details.
Select Create repository.

Note
Nexus Repository can proxy only repositories that provide Composer v2 metadata. Repositories that provide only Composer v1 metadata cannot be proxied.
Composer Hosted Repository
Use Nexus hosted repository when you want to publish and store your own internal artifacts and third party components, so they can be consumed via Nexus. To learn more, check Hosted Repositories.
To create a Composer hosted repository, take the following steps:
Navigate to Settings → Repository → Repositories.
Select Create repository.
From the list of recipes, select composer (hosted).
In the form that appears, complete the required fields.
Repository Name, for example composer-hosted
Blob store
Complete the additional fields for configurations you wish to add for creating your repository. Available configurations differ by repository format and type. See Configurable Repository Fields for more details.
Select Create repository.

Tip
To add Composer archives through the Nexus Repository user interface, see Uploading Components. Each archive must contain a valid composer.json file with a package name in vendor/package format. The values in version field in composer.json and the optional Version field in Upload UI must be the same.
If hosted repository metadata must be repaired, configure and run the Repair - Rebuild Composer repository metadata (p2 manifests) task. Select the hosted Composer repository to repair. You can optionally limit the task to a specific vendor or package. Configure Base URL only when it is not configured. See Tasks.
Composer Group Repository
Use Nexus group repository when you want to combine multiple other repositories (proxy, hosted, and other groups) and expose them through a single URL. To learn more, check Group Repositories.
To create a Composer group repository:
Navigate to Settings → Repository → Repositories.
Select Create repository.
From the list of recipes, select composer (group).
In the form that appears, complete the required fields.
Repository Name, for example composer-group
Blob store
Member repositories in desired order
Complete the additional fields for configurations you wish to add for creating your repository. Available configurations differ by repository format and type. See Configurable Repository Fields for more details.
Select Create repository.

Note
Member order determines package precedence. If multiple member repositories provide the same package version, Nexus Repository uses the package from the first matching member.