Skip to content
Latchkey

What Is composer.lock?

composer.lock explained, including what it does and how it matters in CI/CD.

composer.lock records the exact resolved versions of all PHP dependencies.

What it is

It guarantees that composer install produces the same dependency set everywhere. Commit it for applications.

Why it matters in CI/CD

CI relies on composer.lock for reproducible installs; running composer update in CI would defeat this and is discouraged.

Key takeaways

  • composer.lock pins exact PHP deps.
  • Commit it for applications.
  • Never run composer update in CI.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →