Install Nginx on Mac OS X

Anton Lytvynov
2 min readApr 12, 2021

Run Nginx locally and play with basic configs

Install with brew

First of all your brew will run updates

Brew updates

Nevermind if you get an error, rerun the command.

Check your nginx installed

nginx -h

You should see

Nginx help

To check you nginx version

nginx -v
Nginx version

Run nginx

sudo nginx

Check that it runs

ps aux | grep nginx

You should see something like

Check Nginx process

Or simply in your browser go

what is the same.

Stop nginx

sudo nginx -s stop

Nginx configs

Basic configuration file is here /usr/local/etc/nginx/nginx.conf.

So you can vim it or subl.

vim /usr/local/etc/nginx/nginx.conf
subl /usr/local/etc/nginx/nginx.conf

That’s mine initial nginx.conf

Nginx configuration file

What Next?

You can read how to config multiple sites on your local here.

I regularly add other posts. If you want to be notified you can also subscribe here.

Thank you for your attention

Thank you for your attention.

Do you need help with web and mobile development? Feel free to contact me here.

P.S. I really appreciate your like or share 🙏.

--

--

Anton Lytvynov
Anton Lytvynov

Written by Anton Lytvynov

CEO & Founder of Lytvynov Production, Senior web developer, architect, cryptocurrencies trader, https://lytvynov-production.com

No responses yet