WindowsLinux

Where Is the Composer Cache Stored?

Composer cache and global config home on Windows, macOS and Linux, plus the commands that print the live paths.

Last updated

Composer splits its footprint two ways: a home directory for global config and packages, and a cache directory for downloaded zips. Both move with environment variables.

Because overrides are common in CI images and shared hosts, the config commands below are the reliable source. Defaults are a starting guess, not ground truth.

Where Composer stores this, by platform

Windows
%LOCALAPPDATA%\Composer\files

Default cache layout; files subdirectory holds the zips. Confirm with composer config --global cache-dir. COMPOSER_CACHE_DIR overrides it.

Linux
~/.cache/composer/files

Default only. Confirm with composer config --global cache-dir, since COMPOSER_HOME moves both home and cache.

Frequently asked questions

How do I check my real Composer paths?

Run composer config --global cache-dir and composer config --global home. Output reflects COMPOSER_HOME and COMPOSER_CACHE_DIR overrides, so trust it over any documented default.

How do I clear the Composer cache?

Run composer clear-cache. It empties the download cache safely. Installed vendor directories in your projects are untouched.

Notice an outdated path? Let us know.