1

I do not really care for WordPress, but one thing that it has going for is a dead simple local development environment. In fact, it free software called "Local". It took all of five minutes to get running.

Meanwhile, it took several hours to do a basic set up of Vagrant on Windows, configure Craft to run locally, and then there was various back and forth over obscure server issues until I could finally get it to work. And when it did, the control panel ran rather slowly. I gave up and went back to mapping an FTP connection as a network drive, and just working on files locally, saving them, and then hitting the live site.

I recognize these are different programs, but is there any way to set up Craft for local development that doesn't require an advanced degree in Apache/Vagrant/Docker/whatever the flavor of the month is?

I don't really care if I'm using WAMP, Docker, or whatever, but I would like to find something that is straightforward, with repeatable results, so the next time I have to spin up an install, I don't have to remember 50 steps to do so.

And yes, I am sticking to Windows 10.

Thanks in advance.

1
  • Postscript for anyone reading this now, I have looked at most of the options above, and they are still, in my view, needlessly complicated, or their documentation is out of date. I will soldier on and try to find something that works the first time.
    – 4midori
    Feb 10, 2021 at 0:14

4 Answers 4

3

If you're used to Local you can also use that for Craft.

Here's 2 articles to get you started:

https://medium.com/@madebyraygun/a-quick-and-easy-local-environment-for-craft-3-4fd7c7ff5815

and

https://www.tyssendesign.com.au/articles/craft/using-local-by-flywheel-with-other-cms/

I'm also hearing good things about https://ddev.readthedocs.io/en/stable/ but haven't tried that one myself.

And it looks like Pixel and Tonic have developed something of their own: Craft Nitro

https://craftcms.com/blog/craft-nitro

2

For windows, have you checked out Laragon?

For Mac and Linux there is valet that is probably simpler than vagrant.

Valet for mac

Valet for linux

Hope this helps.

2

The advantage of Docker/Vangrant, etc. is they help create a server similar to production so you run into less issues when deploying. However, those setups are often overkill and complex especially if you don't collaborate on a team.

The good news is Craft is simply a LAMP application, like WP, so any stack that includes a web server like Apache or Nginx and a database like MySQL or Postgres will work.

However, Craft has more moving parts, particularly getting Composer running. I wasn't thrilled when Craft 3 moved over Composer but once you get acquainted it's not as tough as it appears.

I don't use Windows on a daily basis but I do use MAMP on a Mac and they also have a version for Windows. In the past, I've also had success with XAMPP on Windows as well. Once you get your stack installed, you'll want to get Composer installed and you should be mostly there.

FWIW you can use Local or any other WP dev environment, just remove the WP files and tables and replace them with Craft's. As you know, WP stores its credentials in wp-config.php, Craft's equivalent is .env.

2

I wrote one of the articles about using Local and Craft that @erwinheiser mentioned above. I had enough trouble with Local over the years that I've since switched to Lando, which is an easy to use, cross-platform local development tool built on top of Docker. (No Docker experience necessary.) I use the built-in LAMP profile with Craft on a daily basis with no problems at all.

But you should really keep an eye on Nitro, which is Craft's own local dev tool. It's in beta and should be available for Windows soon.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.