Skip to content

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.

6 min read

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

WhatSizeGuide
Homebrew packages7.0 GBHomebrew packages
Docker app and data3.0 GBDocker
JDKs1.5 GBJDKs
Database tools1.4 GBdatabase GUIs
Cross compiler1.4 GBcross compilers
Homebrew var: MySQL, MongoDB, logs1.0 GBHomebrew var
Gradle1.0 GBGradle
Cloud CLIs1.05 GBcloud 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

  1. docker system df, then prune what is unused.
  2. Database data for databases you no longer run.
  3. Old runtime versions: JDKs, Node, Python.
  4. brew cleanup for old package versions, and brew uninstall for tools used once.
  5. Log files from Homebrew services.
docker system df
brew services list
/usr/libexec/java_home -V
du -sh /opt/homebrew/Cellar/* | sort -h | tail -10

Related: 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.

Read next