Craftbox
A Vagrant "Craft Box" for Craft CMS
Craftbox is a simple Vagrant box running Ubuntu 14.04 and targeted for Craft development. Craftbox is intended for Craft developers (like me) that would love to have a simple Vagrant box that installs Craft and all their favorite development tools. Special thanks to Jalen Davenport for getting me started on this https://github.com/jalenconner/craftbox/
Installation
- Install VirtualBox - https://www.virtualbox.org/
- Install Vagrant - http://www.vagrantup.com/
- Verify Vagrant is installed by running
vagrant -v
in your terminal. - Install Vagrant Triggers for db import and backup
vagrant plugin install vagrant-triggers
- Verify Vagrant is installed by running
- Download Craftbox (choose one of the following ways):
- Download and extract the GitHub repository - https://github.com/akukral/craftbox/archive/master.zip
- Clone the GitHub repository -
git clone https://github.com/akukral/craftbox.git
- Navigate to the folder you just downloaded and run
vagrant up
in your terminal. Please be patient; it always take a little time to download and boot up the VM the first time. - Visit http://192.168.33.10 in your browser and you should see your Craft site.
- That's it! Were you expecting more?
Basic Vagrant Commands
Start or resume your server - vagrant up
Pause your server - vagrant suspend
Turn off your server - vagrant halt
SSH into your server - vagrant ssh
Usage
Basic NPM/Gulp
Use npm install
to install Gulp and package.json dependancies.
Run gulp
to spin up local server at http://localhost:3000 with BrowserSync once your vagrant server is up.
Run gulp build
to compress js and css.
Provisioning
I am currently using Ansible to provision the box. You can find all the provisioning files in the provisioning folder. Vagrant uses the Vagrantfile to run a shell script on the VM that installs Ansible and starts the Ansible playbook. That way you don't have to install Ansible on your host machine.
Changing the IP
Craftbox is setup to use the IP address of 192.168.33.10. If this IP is conflicting with something on your network, you may change it in the Vagrantfile to the IP address of your choosing and then run vagrant reload
in your terminal.
Development URL
So who would want to visit http://192.168.33.10 when instead they could just browse to http://craftbox.dev?
$ vagrant plugin install vagrant-hostsupdater
$ sudo visudo
- Add the following to the end of the file:
# Allow passwordless startup of Vagrant with vagrant-hostsupdater.
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
Cmnd_Alias VAGRANT_HOSTS_REMOVE = /usr/bin/sed -i -e /*/ d /etc/hosts
%admin ALL=(root) NOPASSWD: VAGRANT_HOSTS_ADD, VAGRANT_HOSTS_REMOVE
- Visit http://craftbox.dev
- You can configure this url in the Vagrantfile.
- That's it! Were you expecting more?
A big thanks to the wonderful Vagrant::Hostsupdater plugin.
What's Installed
View the full list of packages. Is there something that you think ought to be included here? Open an issue and let me know!
Credentials
SSH Users
Username | Password |
---|---|
vagrant | vagrant |
MYSQL Details
Property | Value |
---|---|
database name | craftbox |
database user | craftbox_user |
database password | craftbox_pass |
database host | localhost |
ADMIN Details
Property | Value |
---|---|
username | admin |
password | password |
admin url | http://192.168.33.10/manager |
Additional Links
Contributing
I know Craftbox definitely could use some help and I'm sure it probably has its share of bugs too... So I'd love for anyone to help assist me develop this box further. Just open an issue and let me know what it is; be it a bug, tip, feature idea, question, or anything! Or if you are feeling code-savvy, fork my repo, make your changes, and create a pull-request.
Change Log
Current Version : 1.1.0 - Updated to PHP7
View the full changelog.
Roadmap
Nothing currently...
License
© 2016 Jalen Davenport
Apache 2.0; view license
Thanks
I'd like to give my thanks to Jalen Davenport