Time for another quicky! I’ve been taking an interest in CraftCMS over the last couple of weeks for a number of reasons, mainly because I’ve heard good things about it but also because it’s always good to fiddle with new things, right? I’ve been working at breaking out of the Bootstrap ecosystem (I’ll push out a post about that soon!) so looking at a potential alternative to WordPress was also on my cards.

Now, I’ve installed and had a play with Craft briefly before, however that was back when I was 100% on a WAMP stack install – now that Devilbox is my go-to dev environment I needed to take a look at how to get a test site up and running there. Fortunately it was almost an identical process to Symfony, which I’ve already documented here!

So, what’s the steps? Well, they’re pretty straightforward…

1. Install Composer

You know the drill…

2. Create the vHost folder

Make a new folder for your project in devilbox/data/www.

3. Install Craft

Follow the instructions in my Symfony article to get into the Devilbox’s PHP environment. The command you’re going to want to run inside your vHost folder is:

composer create-project craftcms/craft craft

Which will install Craft into a folder called craft.

4. Set up a symlink

As with Symfony, you’re going to want to symlink in your webroot – for Craft that’s /web, so you need to run:

ln -s craft/web/ htdocs

5. Set up your DNS

Just add your DNS entry to your hosts file, i.e.:

127.0.0.1 craft-project.loc

6. Set up your database

As Craft is a CMS it comes with an out of the box requirement to set up a database. Hit up your PHPMyAdmin to create one.

7. Run the Craft setup

This can be done from the command line by running:

./craft setup

Or from your browser by visiting:

http://craft-project.loc/index.php?p=admin/install

And there you go! That will install and set up CraftCMS ready for you to get building sites!

As always, hope this helps and shout up below with any comments!