Hosting a seperate wordpress project on localhost

There are a bunch of different ways you can approach this.

  1. Modify your existing LAMP installation — Using your existing LAMP stack in /var/www/html (I assume you are on a Mac?) you could use Virtual Hosts in your Apache config files to configure multiple sites, each in their own subdirectory. Typically this also requires you to add an entry for each of your sites in hosts file: /etc/hosts on Mac/Linux or C:\Windows\System32\Drivers\etc\hosts on Windows. You will also need to add a new database into your MySQL server and configure permissions for it.

  2. Use XAMPP — You can do the same with XAMPP but it appears you will have to follow mostly the same steps as #1. Here is a blog post that explains it.

  3. Use MAMP — With MAMP is appears you do not have to worry about virtual hosts but you still need to add new databases. Here is a blog post that explains it on MAMP.

  4. Buy Desktop ServerDesktop Server has a user interface for creating sites so if you have the funds it might be a good option to consider, and I hear they have great tech support.

  5. Use Local by FlywheelLocal by Flywheel is another option that is provided by the webhost Flywheel. It also has a user-interface that can be used to create multiple websites. One of its strongest features is its integration with Flywheel, so if they are your host this would be a really good option to consider.

  6. Use a Docker-based solutionDocker is system software that runs applications as containers and is all the rage in big data centers. Some people have created Docker-based containers for local WordPress development. Although containers can be used in many ways, the ones I am referring to here package the entire stack required for WordPress into a single container and thus the way to have multiple sites is to use multiple copies of these containers. Examples include Bitnami, wp-local-docker, Nimble, DDev, Kalabox, Lando, Laradock, Docker2WordPress, wp-docker-stack, and there are probably 50 more if you just google for them.

  7. Build a Docker-based solution — Docker being a pretty technical system means that lots or pretty technical people use it, and they like to build their own so that is (one reason) why there are so many. Given that, you might want to build your own too because you might not be happy with others have built. So here are some articles that will show you how: here, here, here, here and here.

  8. Use a VirtualBox+Vagrant Solution (VB+V)VirtualBox is open-source software that allows you to run another computer inside your computer but simulated using software. This is often referred to as a virtual machine and that is what VirtualBox allows you to do, i.e. run Linux effectively as just another application on your Mac or your Windows computer. Vagrant is another open-source software solution written in Ruby that runs from the command line and automates the features and functionality of VirtualBox by reading a declarative script called a Vagrantfile. There are several VB+V solutions set up to enable WordPress local development and here are just a few: Chassis, Trellis, VCCW, Eleanor elephant, ScotchBox. Which brings us to either single-project/site Vagrants or multi-project/site Vagrants. I’ll start with the latter.

    1. Use VVV – The only one that I know for certain is a multi-project/site VB+V is VVV. It is the granddaddy of VB+V boxes for WordPress and has tons of features. It is also not for the faint-of-heart, but it does has a site creation wizard 3rd-party tool called VV.

    2. Use WPLib Box – The single-project/site solution using VB+V I know best is WPLib Box. I know it because my team built it starting over 2 years ago because we wanted something easier to get XDEBUG working with PhpStorm, but many of the other VB+V solutions are also single project/site boxes. One of the benefits of going with a single-project/site box is that the sites are completely decoupled from all other sites as each of your site projects use another copy of the box. If after going through all the options you want to try this one we’ll be happy to help with any issues you run into via our Slack.

So obviously there are now tons of options for you to choose from to meet your stated objectives. I hope I did not overwhelm you, but hope that I gave you a good overview so that you can make the best choice for your needs.