HowTo: My Dev Environment
A native macOS stack for Magento development
On this page
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
brew install php@7.2
brew install composerI 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):
brew install httpdEach project gets a virtual host and a .test domain, resolved locally with dnsmasq so I never touch /etc/hosts
again:
brew install dnsmasqDatabase, cache and search
Magento needs a database, and benefits massively from Redis and a search engine:
brew install mysql
brew install redis
brew install elasticsearchI 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.
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.