Skip to content

Package cache

Composer, npm, Yarn, pnpm, pip, uv, Go (modules and build cache), Bundler, Maven and NuGet keep their downloads in a package cache. It’s mounted at /var/cache/envoryx into the PHP, Node.js, Python, Go, Ruby, Java and .NET containers, the workers and the one-shot containers that scaffold templates. Each project has its own, on the Envoryx side in /config/projects/<id>/cache, so reinstalling a project’s dependencies doesn’t download them again.

Ten projects with the same packages download them ten times. Under Settings → Package cache you can tick Share the package cache between projects: all projects then use one cache (/config/cache), a package is downloaded once, and the second Laravel project is set up in a fraction of the time the first one took. Projects switch over when they’re restarted.

Only do that when you trust everyone who works on a project in your Envoryx. Every project can write the shared cache, and Composer, pip, Maven and several others take a cached package without checking it against the lock file. A developer of one project could plant code in there that another project then installs. If you’re the only one using Envoryx, there’s nothing to worry about.

Each tool finds the cache through a variable:

Tool Variable pointing into the cache
Composer COMPOSER_CACHE_DIR
npm npm_config_cache
Yarn 1 YARN_CACHE_FOLDER
Yarn 2 and later YARN_GLOBAL_FOLDER (the global cache lives in there)
pnpm store-dir in ~/.config/pnpm/rc, storeDir in ~/.config/pnpm/config.yaml (see below)
pip PIP_CACHE_DIR
uv UV_CACHE_DIR
Go GOMODCACHE, GOCACHE
Bundler BUNDLE_USER_CACHE with the global gem cache switched on
Maven MAVEN_OPTS with -Dmaven.repo.local
NuGet NUGET_PACKAGES, NUGET_HTTP_CACHE_PATH

If a project needs something else, you can override these like any other project variable. pnpm is the odd one out: it doesn’t read its store location from any variable of its own, and the one it does read (npm_config_store_dir) makes npm print a warning on every command. So Envoryx writes pnpm’s own config files into the project home: ~/.config/pnpm/rc with store-dir=/var/cache/envoryx/pnpm-store for pnpm up to 10, and ~/.config/pnpm/config.yaml with storeDir: /var/cache/envoryx/pnpm-store for pnpm 11 and newer, which no longer reads rc. It writes each one only when it isn’t there yet, and the files belong to you, so change them if you want the store somewhere else. pnpm can’t hard-link across mounts and copies the files from the store into node_modules instead, which is still a lot faster than downloading them again.

One Yarn case stays outside the cache: a Yarn 2+ project with zero-installs (enableGlobalCache: false, the cache committed under .yarn/cache). YARN_CACHE_FOLDER sends that cache to the package cache too, so set YARN_CACHE_FOLDER=/var/www/html/.yarn/cache as a project variable for such a project (with the full path: a relative one counts from wherever you run yarn). Ruby gems are installed into the project home, one directory per Ruby version (/home/envoryx/.gem/ruby/<X.Y.0>, so ~/.gem/ruby/3.4.0 for Ruby 3.4).

Gradle isn’t in the package cache at all: it keeps its home in ~/.gradle in the project home, see Java.

The caches never shrink on their own. Under Settings → Package cache you can see how much each tool keeps there, added up over all projects, and empty one tool’s part or all of it; the next install simply downloads again. Instance backups leave the caches out, since they can always be rebuilt. On Unraid it sits with /config on the appdata share, which usually means the SSD pool.