Linux

Where Does rebar3 Store Cache and Build Data?

rebar3 caches Hex packages in ~/.cache/rebar3 with checkouts beneath, while each project keeps _build artifacts and rebar.lock beside its rebar.config.

Last updated

rebar3 splits Erlang dependencies between a global Hex cache and per project build trees. The cache under ~/.cache/rebar3 holds downloaded packages shared across projects. Each project compiles into its own _build folder with a lockfile pinning versions.

That split keeps builds reproducible without bloating checkouts. Commit configs and locks, ignore _build, and let the cache accelerate fetches. Cache corruption manifests as repeat fetch failures that one deletion fixes.

Where rebar3 stores this, by platform

Linux
~/.cache/rebar3

Shared Hex package cache across projects. Clear packages subfolder to refetch. Project _build trees stay separate per checkout.

Frequently asked questions

How do I clear the rebar3 Hex cache?

Delete ~/.cache/rebar3/hex/hexpm/packages to force fresh downloads, keeping project _build folders intact. Corrupt tarballs hide in the cache and break fetches repeatedly. Next build refetches cleanly.

How do I reproduce a rebar3 build elsewhere?

Copy rebar.config plus rebar.lock and let _build regenerate with rebar3 compile. Lock files pin exact deps while configs declare them. The cache speeds rebuilds but never replaces lockfiles.

Notice an outdated path? Let us know.