Docker Community Forums

Share and learn in the Docker community.

Should I use docker to replace MAMP?

I’m currently trying to decide if I should switch over to docker for local web development or if I should keep using MAMP PRO.

My main reason for looking into docker is the ability to customize the whole environment to make it use the same versions of httpd, php and MariaDB as the live server does. I did run into some issues with MAMP because it runs MySQL instead of MariaDB and because I can’t pick the exact same php version as the live server. This caused some small problems where certain queries and PHP functions that did not work locally.

It seems that docker is a lot more work to setup and maintain but also offers a lot more features and does not force you to pay/upgrade every year.

Our VPS server is using apache and nginx as a reverse proxy.

  • Apache HTTPD 2.4.29
  • Nginx 1.20.1
  • PHP 7.3.29
  • MariaDB 10.1.48

I’m planning on using ssl certificates and local host names like https://my-project instead of https://localhost in order to be able to run multiple projects simultaneously.
The setup should be as simple as possible so that every developer is able to setup the environment on his laptop and create a vhost for each project.

So, should I make the switch or should stick to MAMP PRO?

I have no idea what MAMP PRO is and what it’s USP is. I neither have seen a feature listt or a feature comparison between the PRO and OSS version.

Though, I can say something about the docker part :slight_smile:

So far it’s a perfect fit for docker.

Your pick:

  • if your devs use Linux as os: perfect, just install docker-ce and be good
  • If you devs use Windows or MacOS: either use Docker for Desktop or prepare a Linux VM for them

Then create a docker-compose.yml with the images of the components with the right versions and create a container configuration as needed.

You could simply add fqdns to the hosts /etc/hosts file and let them resolve to 127.0.0.1. You only need the name resolution on the host side. For container to container communication you can leverage the dns-based service discovery provided by user defined docker networks.

I’ve been using MAMP Pro for a while 4 years ago for my WordPress sites. The app had a few bugs I was super annoyed with and my experience with the support wasn’t that good neither. I switched pretty quickly to macOS’ native httpd, PHP and MySQL servers. Then, 2-3 years ago, I’ve moved to Docker. It’s by far a better solution compared to MAMP Pro but it also has a steep learning curve and I’ve experienced a lot of bugs with Docker Desktop for Mac in the first two years. But now the macOS Docker App seems to run perfectly and the performance for my local Docker WordPress apps has improved almost to the same level as my DigitalOcean droplets.