A backend developer's Mac: containers, databases and runtimes, measured
Docker, local databases, JDKs and Homebrew services each keep data outside your projects. Measured on a real Mac, with the order to clear them.
Backend work fills a disk differently from frontend work. The projects are small; what grows is everything that runs them: container images, database files, language runtimes and the services Homebrew starts for you.
The measured list
| What | Size | Guide |
|---|---|---|
| Homebrew packages | 7.0 GB | Homebrew packages |
| Docker app and data | 3.0 GB | Docker |
| JDKs | 1.5 GB | JDKs |
| Database tools | 1.4 GB | database GUIs |
| Cross compiler | 1.4 GB | cross compilers |
| Homebrew var: MySQL, MongoDB, logs | 1.0 GB | Homebrew var |
| Gradle | 1.0 GB | Gradle |
| Cloud CLIs | 1.05 GB | cloud CLIs |
Docker is the one to watch
Docker Desktop was modest here, 1.0 GB of data and a 2.0 GB app, because few images had been pulled. It is the item that changes fastest: one docker compose up for a stack with a database, a queue and a search engine can add several gigabytes, and they stay after the stack is stopped. Pruning Docker images and volumes is the routine that keeps it in check.
Databases twice
A database installed with Homebrew keeps its data in /opt/homebrew/var. The same database in Docker keeps it in a volume inside Docker's disk image. Developers often have both, from different projects, and forget one. On this Mac MySQL's data (314 MB) and MongoDB's (206 MB) were in Homebrew's folder. More in database data directories.
The order to clear
docker system df, then prune what is unused.- Database data for databases you no longer run.
- Old runtime versions: JDKs, Node, Python.
brew cleanupfor old package versions, andbrew uninstallfor tools used once.- Log files from Homebrew services.
docker system df
brew services list
/usr/libexec/java_home -V
du -sh /opt/homebrew/Cellar/* | sort -h | tail -10Related: Postgres.app old data directories on Mac.
Related: rebar3 and Erlang caches.
Common questions
What takes the most space on a backend developer's Mac?
Homebrew packages, Docker images and volumes, database data and language runtimes. On the Mac measured Homebrew packages were the largest at 7.0 GB.
Where does Docker store its data on a Mac?
In a disk image inside ~/Library/Containers/com.docker.docker. docker system df shows what is in it.
Does stopping a Docker container free space?
No. Stopped containers, their images and volumes stay until pruned.
Where do Homebrew databases keep their data?
In /opt/homebrew/var, for example var/mysql. The data stays even after the database is uninstalled.