# Homebrew Cache on Mac: Is It Safe to Delete?

> The Homebrew cache holds downloaded bottles and cask installers. Deleting it is safe: brew downloads files again only when it needs them.

- Updated: 2026-10-10
- URL: https://fresh.ist/caches/homebrew/

**TL;DR:** Yes. ~/Library/Caches/Homebrew only stores the archives and installers that brew downloaded. Your installed formulae and apps live elsewhere and keep working after you clear it. The cost is a fresh download the next time you reinstall or upgrade something. Start with brew cleanup, which trims the cache by Homebrew's own rules.

## Facts from the Freshist app

- Category in Clean: Homebrew Cache — "Downloaded install archives. Homebrew re-downloads them if ever needed."
- Location: `~/Library/Caches/Homebrew`
- Risk level: Low risk — Rebuilt automatically by macOS or the app that made it. Freshist selects these for you — you still see every item before anything moves.
- Selected by default: yes
- What Freshist does: Moves the selected items to the Trash, so you can undo. Nothing is deleted outright.

## What lives in the Homebrew cache

Every time you run `brew install`, `brew upgrade` or `brew reinstall`, Homebrew first downloads something: a precompiled **bottle** (a `.tar.gz` of a formula built for your macOS version), a source tarball if no bottle exists, or the `.dmg`, `.pkg` or `.zip` behind a cask. Those downloads land in the cache folder, and brew installs from there.

You'll typically find:

- `downloads/`: the actual files, named with a hash prefix so different versions don't collide.
- Symlinks at the top level pointing into `downloads/`, with friendlier names like `node--22.9.0.arm64_sequoia.bottle.tar.gz`.
- `Cask/`: links to cask installers.
- `api/`: the JSON formula and cask index brew fetches instead of cloning the old Git taps.
- `bootsnap/`: a small cache that speeds up brew's own Ruby startup.

Right after a cleanup the folder may hold little more than `api/` and `bootsnap/`. Nothing in here is your data.

## Why it grows

Homebrew already tidies up after itself. According to the [Homebrew FAQ](https://docs.brew.sh/FAQ), it removes old versions when you upgrade and runs a fuller cleanup every 30 days. `brew cleanup` itself removes downloads more than 120 days old.

The cache still grows if you install large casks (IDEs, browsers, design tools), upgrade often, or set `HOMEBREW_NO_INSTALL_CLEANUP=1`, which turns the automatic pass off. Big cask installers are usually the bulk of it, since brew keeps the latest download for each installed package.

## What happens if you delete it

| Removed | Effect |
|---|---|
| Downloaded bottles and source tarballs | Re-downloaded the next time a formula is installed or reinstalled |
| Cask installers | Re-downloaded on the next cask install or upgrade |
| `api/` index files | Fetched again on the next `brew update` or install |
| Installed formulae, casks, settings | Not affected; they live outside the cache |

The only practical loss is offline reinstalls. If you rely on reinstalling a specific old version without a network connection, keep its file.

## Check its size first (read-only)

```sh
brew --cache                 # prints the cache path
du -sh "$(brew --cache)"     # total size
brew cleanup -n              # dry run: lists what cleanup would remove
```

`brew cleanup -n` is the useful one. It shows exactly what brew considers stale before anything is touched.

## Clear it the Homebrew way

Use brew's own command before reaching for Finder:

1. `brew cleanup` removes stale lock files, outdated downloads and old installed versions, plus any download older than 120 days. Change that window with `HOMEBREW_CLEANUP_MAX_AGE_DAYS`.
2. `brew cleanup -s` also scrubs downloads for the latest versions. Downloads of installed packages are still kept.
3. `brew cleanup --prune=all` removes every cache file regardless of age.

Homebrew's own help text names one more step if you want the folder empty: `rm -rf "$(brew --cache)"`. That is safe, but it's the blunt option, so run the dry run first and quit any `brew` command that's still running.

Clearing the cache does not remove old installed versions in the Cellar. `brew cleanup` handles those separately, and `brew cleanup -n` lists them too.

## When the cache is worth keeping

Keep the cache if you work on a slow or metered connection and expect to reinstall soon, or if you maintain a machine image and want installers on hand. Otherwise, a periodic `brew cleanup` is enough. For other developer folders that grow the same way, see [developer caches on Mac](/blog/developer-caches-mac/) and the [npm cache](/caches/npm/) guide.

## Sources

- [Homebrew FAQ: cleanup and cache location](https://docs.brew.sh/FAQ)
- [Homebrew manual: brew cleanup](https://docs.brew.sh/Manpage#cleanup-options-formulacask-)
- [Homebrew environment variables](https://docs.brew.sh/Manpage#environment)

## Frequently asked questions

### Does clearing the Homebrew cache uninstall any packages?

No. Installed formulae live in the Cellar under your Homebrew prefix (/opt/homebrew on Apple silicon, /usr/local on Intel) and casks install into /Applications. The cache only holds the files they were installed from.

### Why is the cache still large after brew cleanup?

By default brew cleanup keeps downloads for everything currently installed and only removes stale files older than 120 days. Use brew cleanup -s to scrub downloads for the latest versions too, or brew cleanup --prune=all to drop everything older than zero days.

### Can I move the Homebrew cache to another drive?

Yes. Set the HOMEBREW_CACHE environment variable in your shell profile to another folder, and brew will download there instead. brew --cache then prints the new location.

---

Canonical page: https://fresh.ist/caches/homebrew/
Official site: https://fresh.ist/ (fresh.ist only)
Generated: 2026-10-10
