HowTo: My Dev Environment

A native macOS stack for Magento development


People often ask me what I use to develop locally. I have gone through Vagrant and Docker over the years, but for the projects I work on day to day I keep everything installed natively on macOS. It is fast, and when something breaks I know exactly where to look. This is the stack I run.

Everything is installed through Homebrew , which keeps upgrades painless.

PHP

bash
brew install php@7.2
brew install composer

I switch PHP versions per project by linking the one I need. A couple of aliases in my .zshrc make that a one word command.

Web server

I use Apache directly (nginx works just as well, it is a matter of taste):

bash
brew install httpd

Each project gets a virtual host and a .test domain, resolved locally with dnsmasq so I never touch /etc/hosts again:

bash
brew install dnsmasq

Magento needs a database, and benefits massively from Redis and a search engine:

bash
brew install mysql
brew install redis
brew install elasticsearch

I point Magento’s cache and full page cache at Redis, and sessions too, it makes a noticeable difference on a real catalog.

The little helpers

Two tools I would not work without:

  • n98-magerun , the swiss army knife for Magento.
  • Composer, obviously, for everything dependency related.
This native setup is fast but it does tie your machine to specific versions. If you jump between very different projects a lot, a containerised option like Valet Plus or Docker keeps things isolated. I ended up combining both.

That is pretty much it. Nothing exotic, just a handful of Homebrew formulae and a couple of aliases, but it has served me well for years.

Hope this helps.

If you have any question or know a better setup, feel free to share in the comments below.