PHPackages                             nix-community/composer-local-repo-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. nix-community/composer-local-repo-plugin

ActiveComposer-plugin[DevOps &amp; Deployment](/categories/devops)

nix-community/composer-local-repo-plugin
========================================

A plugin for Composer which provides a command to create local Composer repository for your projects.

1.1.0(2y ago)241MITPHPPHP &gt;= 7.2

Since Apr 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/nix-community/composer-local-repo-plugin)[ Packagist](https://packagist.org/packages/nix-community/composer-local-repo-plugin)[ Docs](https://github.com/nix-community/composer-local-repo-plugin)[ GitHub Sponsors](https://github.com/drupol)[ RSS](/packages/nix-community-composer-local-repo-plugin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

Composer Local Repo Plugin
==========================

[](#composer-local-repo-plugin)

This plugin, built for [Composer](https://getcomposer.org/), facilitates the creation of a local `composer` type repository ([refer to documentation](https://getcomposer.org/doc/05-repositories.md#composer)) from an existing package. Basically, this plugin let you use Composer in "offline" mode.

The repository type `composer` is identical to the format used by [Packagist](https://getcomposer.org/). It uses a specific structure, featuring a manifest file named `packages.json` and a unique directory structure. Each version of the package within the repository has its own corresponding source.

Created with the goal of installing a PHP package in a repeatable manner, this plugin eliminates the need for network access post repository creation.

The plugin is currently used within Nix. More information can be found in the [corresponding PR](https://github.com/NixOS/nixpkgs/pull/225401), marking the project's inception.

This project has been heavily inspired of [`fossar/composition-c4`](https://github.com/fossar/composition-c4/) from [Jan Tojnar](https://github.com/jtojnar).

Requirements
------------

[](#requirements)

- Composer 2

Installation
------------

[](#installation)

Install the plugin globally once:

```
composer global require nix-community/composer-local-repo-plugin

```

Usage
-----

[](#usage)

### Using an updated `composer.lock` file (recommended)

[](#using-an-updated-composerlock-file-recommended)

1. Navigate to the package directory, or use the `--working-dir` option.
2. Make sure the `composer.json` and `composer.lock` files are present.
3. Generate the local repository using the command: `composer build-local-repo-lock /path/to/local/repository`. This will create a local `composer` repository in the specified directory and generate an updated file `composer.lock` in the same location. Use the `-r` or `-m`options to generate only a repository or the `composer.lock`, respectively. For more details, refer to the command help: `composer build-local-repo-lock --help`.
4. The combination of the package sources and the local repository we just created are now strictly enough to build the `vendor` directory necessary for the package to work. Therefore at this stage, we can disable the network as no further network access is required or you can use the environment variable `COMPOSER_DISABLE_NETWORK` set to `1` to do so.
5. Copy the updated `composer.lock` file in the package directory: `cp /path/to/local/reposity/composer.lock .`
6. Finally, install the package by entering the command: `composer install`.

### Using a Composer repository type (deprecated since Composer 2.7)

[](#using-a-composer-repository-type-deprecated-since-composer-27)

Note: Since Composer 2.7, this method is deprecated since it doesn't work any more. More info at [composer/composer#11850](https://github.com/composer/composer/pull/11850)

Details1. Navigate to the package directory, or use the `--working-dir` option.
2. Make sure the `composer.json` and `composer.lock` files are present.
3. Generate the local repository using the command: `composer build-local-repo /path/to/local/repository`. This will create a local `composer` repository in the specified directory and generate a manifest file `packages.json` in the same location. Use the `-r` or `-m`options to generate only a repository or a manifest file, respectively. For more details, refer to the command help: `composer build-local-repo --help`.
4. The combination of the package sources and the local repository we just created are now strictly enough to build the `vendor` directory necessary for the package to work. Therefore at this stage, we can disable the network as no further network access is required or you can use the environment variable `COMPOSER_DISABLE_NETWORK` set to `1` to do so.
5. Disable Packagist by entering the command: `composer config repo.packagist false`.
6. Integrate the newly created local `composer` repository into the `composer.json` file using the command: `composer config repo.local composer file:///path/to/local/reposity/packages.json`.
7. Refresh the lock file using the command: `composer update --lock --no-install --no-scripts --no-plugins --no-interaction`.
8. Finally, install the package by entering the command: `composer install`.

In Nix
------

[](#in-nix)

The plugin is used in Nix to build Composer based PHP packages. The combination of the source package and the local repository built with this plugin is unique and Nix uses that for ensuring reproducibility.

### Note

[](#note)

By default, Composer will create symbolic links to the packages, if you want to copy the packages instead, set the environment variable `COMPOSER_MIRROR_PATH_REPOS` to 1

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Recently: every ~44 days

Total

6

Last Release

798d ago

Major Versions

0.0.1 → 1.0.02023-09-10

PHP version history (3 changes)1.0.0PHP ^8.1

1.0.1PHP ^7 || ^8

1.0.3PHP &gt;= 7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/224ac3944109a921ad189323ea05e3017d40a768120a322d7dca4d11ad65daa2?d=identicon)[etu](/maintainers/etu)

![](https://www.gravatar.com/avatar/3a5b33672e6fed2f03fee680279b6bddb884ca494237764e8c4dbb2c77e8bf05?d=identicon)[drupol](/maintainers/drupol)

---

Top Contributors

[![drupol](https://avatars.githubusercontent.com/u/252042?v=4)](https://github.com/drupol "drupol (74 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![jtojnar](https://avatars.githubusercontent.com/u/705123?v=4)](https://github.com/jtojnar "jtojnar (1 commits)")

---

Tags

composerdeploymentpluginrepositoryreproducibility

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nix-community-composer-local-repo-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/nix-community-composer-local-repo-plugin/health.svg)](https://phpackages.com/packages/nix-community-composer-local-repo-plugin)
```

###  Alternatives

[johnpbloch/wordpress-core-installer

A custom installer to handle deploying WordPress with composer

22110.8M47](/packages/johnpbloch-wordpress-core-installer)[civicrm/composer-compile-plugin

Define a 'compile' event for all packages in the dependency-graph

12488.2k15](/packages/civicrm-composer-compile-plugin)[enumag/no-thanks

Prevents symfony/flex from printing thanks reminder.

3315.6k](/packages/enumag-no-thanks)[inpsyde/vip-composer-plugin

A Composer plugin to ease deployment to wordpress.com VIP servers alongside Composer-based development.

1258.2k](/packages/inpsyde-vip-composer-plugin)[stephank/composer-plugin-nixify

Composer plugin to help with Nix packaging

1710.5k](/packages/stephank-composer-plugin-nixify)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
