Running Nginx on OS X is becoming a more attractive alternative to running some of the standard stacks that developers use to set up their environments.

That is, I think many of us are used to running something like this following:

  • Apache
  • MySQL
  • PHP
  • WordPress

That works because the majority of our hosts have these configurations, and it’s a good practice to have our development environment mirror our staging and production environments.

But Nginx is becoming a popular alternative to Apache and other web servers, so we need to update our local machines accordingly.Getting it set up on OS X takes a little more work.

Getting it set up on OS X takes a little work.

Running Nginx on OS X

Many WordPress developers opt to use MAMP or VVV to set up their development environments both of which are reliable alternatives.

But what do you, especially if you’re running MAMP? In other words, what do you do if you want to run Nginx alongside Apache? In that case, check out this short guide by @raamdev.

Running Nginx on OS X - A Gist of Instructions

In a nutshell, the guide captures the following steps:

  1. Installing MacPorts
  2. Updating the relevant files and constants on your machine
  3. Defining Nginx configuration
  4. Starting the server

For those who have been working in environments such as Digital Ocean, then I recommend at least experimenting with this setup.

Personally, I don’t think it’s necessary if you know what you’re doing in both your development and staging or production environments. But if you want to make sure the environments mirror each other as closely as possible, or you may wish to experiment with running Nginx locally. If so, then this is an excellent resource for getting started with exactly that.

If you have alternative resources for setting Nginx up on OS X, feel free to share the in the comments (as I know there are a variety of tools available). In the meantime, check out the guide above. It’s one of the best I’ve found.