LinuxmacOSWindows

Where Do Mix and Hex Store Packages?

Mix homes in ~/.mix with archives beside, Hex caches in ~/.hex. The env vars that relocate each.

Last updated

Mix keeps its home in ~/.mix by default, holding config, scripts, archives, and escripts. Archives install to ~/.mix/archives unless MIX_ARCHIVES says otherwise. Set MIX_HOME to move the whole home, with MIX_XDG opting into XDG paths instead.

Hex package tarballs cache separately in ~/.hex/packages/hexpm with a cache.ets index. Project deps themselves compile into each project's _build and deps folders, not the home. mix local.hex reporting an existing archive path reveals the live locations when in doubt.

Where Elixir Mix stores this, by platform

Linux
~/.mix

Home with archives/ and escripts/ inside. Hex cache at ~/.hex. MIX_HOME beats MIX_XDG beats the default. Same relative layout on macOS and Windows under the profile.

macOS
~/.mix

Same dot folder home, not Application Support. Version managers per Elixir install may want distinct MIX_ARCHIVES to avoid cross version archives.

Windows
%USERPROFILE%\.mix

Same layout under the profile with Hex cache at %USERPROFILE%\.hex. mix local.hex prints the resolved archive path on any OS.

Frequently asked questions

where are hex packages cached

In ~/.hex/packages/hexpm (or %USERPROFILE%\.hex on Windows) with tarballs per package. Project checkouts compile into that project's deps and _build folders instead.

how do i move the mix home

Export MIX_HOME to the new dir, or set MIX_XDG for XDG layout. Archives follow MIX_ARCHIVES independently. Reinstall archives after moving; the old folder holds no project data worth migrating beyond them.

Notice an outdated path? Let us know.