Local MainWP setup using VVV (nginx)

For setting up your MainWP locally on OSX running nginx I use VVV (Varying Vagrants Vagrant). This is a development environment specialy built for WordPress. I wont go into all the details but you can find more info here: https://varyingvagrantvagrants.org/

If you are not used to or don’t want to use the terminal this setup might not be what you want. You need this to start, halt and update your server environment.

There is also a need for you to edit a config file where you set up your sites. So if you are not comfortable with that this is not the local environment for you to use. You might just want to switch to MAMP PRO, not free, but also a very good local webserver environment. More info here: https://www.mamp.info/en/mamp-pro/mac/

What you need…

I use Virtual Box because I had this on my system already. More requirements can be found here: https://varyingvagrantvagrants.org/docs/en-US/installation/software-requirements/

You will also need to install Vagrant and the hostupdater plugin. This last plugin will let you manage local domainnames, like mysite.test or whatever you want to use.

You can read about the install procedure here: https://varyingvagrantvagrants.org/docs/en-US/installation/

Setting up your VVV

You need to install:

  1. VirtualBox

  2. Vagrant

  3. VVV Follow these instructions https://varyingvagrantvagrants.org/docs/en-US/installation/

Best option is to use Git so updating is easy.

  1. Install the hostupdater plugin → To install it, run vagrant plugin install vagrant-hostsupdater in terminal from your vvv-local install directory.

Setting up your MWP site

For adding a new site check the information here: https://varyingvagrantvagrants.org/docs/en-US/adding-a-new-site/

To do this, we will update the sites list by editing the file config/config.yml in the main VVV folder like this:

    skip_provisioning: false
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
      - mwp1.test  
        - { plugin: "mainwp", activate: true }

The site and database will be created when you give a vargrant up --provision in your terminal. The latest wp version will be downloaded to set up the site and database will also be created. Also latest mainwp will be installed. You can remove the custom option if you want to import your own mwp setup later.

Starting up your VVV environment

  1. Navigate to your vvv-local directory in the terminal.

  2. type: vagrant up --provision , and wait for it to finish

  3. After that go to vvv.test and see if your site is listed.

  4. Test if it is working. Default wp-admin login is ‘admin’ and ‘password’.

More credentials can be found here: https://varyingvagrantvagrants.org/docs/en-US/default-credentials/

Tips for running MWP in VVV

  1. Please use a smtp plugin because the VVV won’t send out any mails because it is set up for development purpose. All outgoing mails are caught by MailHog. If you use smtp they will be send normaly. I use wp-mail-smtp or my own version as a mu-plugin can be found here: https://github.com/herbie4/hhdev-wp-smtp-mailer

  2. if you want to use https on the mwp site you need to import the certificate inside the browser you use.

  3. Make sure all environment vars are what MainWP needs them to be. You need to add a file called .user.ini in your public_html root. Put in this code:

# mainwp change curl timeout

Check the mwp status if all is correct.

Finishing up

I think I covered all the issues. If you have any issues the VVV slack channel offer very good support. And always check the VVV docs on the website before.


Nice setup. I like it.

I’m a web developer and do many things other than WP on my development stack, so I do it a little differently. On my Mac, I actually used Homebrew to set up a full LAMP stack using this tutorial.

The person who wrote the tutorial updates it as new versions of MacOS come out. Might be another good option for some others like me.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.