Scotch Box 2.5

A Vagrant LAMP Stack That Just Works

Just Clone and Run "Vagrant Up" WPDistillery: WordPress for Scotch Box

Just a dead-simple local LAMP stack for developers.

Scotch Box is a preconfigured Vagrant Box with a full array of LAMP Stack features to get you up and running with Vagrant in no time.

A lot of PHP websites and applications don't require much server configuration or overhead at first. This box should have all your needs for doing basic development so you don't have to worry about configuring Vagrant and you can simply focus on your code.

No provisioning tools or setup is really even required with Scotch Box. Since everything is packaged into the box, running "vagrant" is super fast, you'll never have to worry about your environment breaking with updates, and you won't need Internet to code.

Features

Server Stuff

  • Ubuntu 14.04 LTS (Trusty Tahr)
  • PHP 5.6
  • Ruby 2.2.x
  • Vim
  • Git
  • cURL
  • GD and Imagick
  • Composer
  • Beanstalkd
  • Node
  • NPM
  • Mcrypt

Database Stuff

  • MySQL
  • PostreSQL
  • SQLite
  • MongoDB

Caching Stuff

  • Redis
  • Memcache and Memcached

Node Stuff

  • Grunt
  • Bower
  • Yeoman
  • Gulp
  • Browsersync
  • PM2

Laravel Stuff

  • Laravel Installer
  • Laravel Envoy
  • Blackfire Profiler

Mailcatcher

  • First: `vagrant ssh`
  • Run: `mailcatcher --http-ip=0.0.0.0`
  • Then visit: http://192.168.33.10:1080

Other Useful Stuff

  • WP-CLI
  • No Internet connection required
  • PHP Errors turned on
  • No Internet connection required
  • Laravel and WordPress ready
  • Operating System agnostic
  • Goodbye XAMPP / WAMP
  • New Vagrant version? Update worry free. ScotchBox is very reliable with a lesser chance of breaking with various updates
  • Super easy database access and control
  • Virtual host ready
  • PHP short tags turned on
  • H5BP’s server configs
  • MIT License

Get Started

Getting started with Scotch Box is a breeze. We'll cover everything, but chances are you've probably already done some of these things.


1 Download and Install Vagrant

Just click here and follow their steps.


2 Download and Install VirtualBox

Follow this link and install Virtual Box.


3 Clone the Scotch Box GitHub Repository

From the command line, you'll want to do this inside the folder where you want your project to be on your computer.

git clone https://github.com/scotch-io/scotch-box.git my-project

4 Run Vagrant Up

Start the box! If this is your first time, the box will need to download. After that, everything should be ultra-fast to start.

vagrant up

5 Access Your Project

Success! You can now access your project by visiting http://192.168.33.10/


Basic Vagrant Commands

This is how you can control your server from the command line.

Start your server

vagrant up

Pause your server

You should do this before shutting down your computer.

vagrant suspend

Resume your server

vagrant up

Delete your server

vagrant destroy

SSH into your server

vagrant ssh

MySQL Database Access

From your application

These are the settings that work when connecting with PHP. You could technically create as many databases as you want.

$connection = mysqli_connect('localhost', 'root', 'root', 'scotchbox');
Key Value
Database Name scotchbox
Database User root
Database Password root
Database Host localhost

From a Desktop Client

You'll need to download either Sequel Pro or Navicat or some other desktop database client. Switching to one of these from phpMyAdmin will be a life changing experience so just do it already. After this, create a "new connection" and select SSH Forwarding and enter these parameters:

Key Value
Database Name (leave blank)
Database User root
Database Password root
Database Host localhost
SSH Host 192.168.33.10
SSH User vagrant
SSH Password vagrant

Other Database Access

PostgreSQL

Key Value
Database Name scotchbox
Username root
Password root
Database Host localhost
Port 5432

MongoDB

Key Value
Database Name scotchbox
Database Host localhost
Port 27017

Installing WordPress


If you want to use WordPress you can use WPDistillery to automatically install WordPress for you. WPDistillery was designed for Scotch Box and allows you to add your preferred language, theme, plugins, options etc. into a reusable configuration file that gets executed within WPDistillery to install WordPress.

Setup

Clone the WPDistillery files into your project root.


                      git clone git@github.com:flurinduerst/WPDistillery.git
                      mv WPDistillery/config.yml config.yml
                      mv WPDistillery/setup.sh setup.sh
                      rm -rf WPDistillery
                    

Your project root should now look like this:


                        - config.yml
                        - public
                        - setup.sh
                        - Vagrantfile
                      

Adjust configuration file and run WPDistillery

  1. add your preferred settings into config.yml (see documentation for detailed informations)

  2. run vagrant and access your server via ssh
  3. vagrant up
    vagrant ssh
  4. update wp cli (0.23+ required)
  5. sudo wp cli update --allow-root
  6. execute the WPDistillery setup
  7. cd ../../var/www/ && bash setup.sh

You can find a more detailed documentation at the WPDistillery Repository.

Follow flurinduerst on GitHub and Twitter for the latest updates to WPDistillery.

Updating the Box

Although not necessary, if you want to check for updates, just type:

vagrant box outdated

It will tell you if you are running the latest version or not of the box. If it says you aren't, simply run:

vagrant box update

Follow us on GitHub and Twitter for the latest updates to Scotch Box.

Setting a Hostname

If you're like me, you prefer to develop at a domain name versus an IP address. If you want to get rid of the some-what ugly IP address, just add a record like the following example to your laptop's host file.

192.168.33.10 whatever-i-want.local

Or if you want "www" to work as well, do:

192.168.33.10 whatever-i-want.local www.whatever-i-want.local

Technically you could also a Vagrant Plugin like Vagrant Hostmanager to automatically update your host file when you run Vagrant Up. However, the purpose of Scotch Box is to have as little dependencies as possible so that it's always working when you run "vagrant up".

The MIT License (MIT)

Copyright (c) 2014-2015 Nicholas Cerminara, scotch.io, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.