It's been a while (maybe too long) since our last Scotch Box update. If you're not familiar with Scotch Box, it's a dead-simple local LAMP stack for Vagrant. It was built about a year and half or so ago back when Vagrant was the hot new thing coming out. Vagrant had a tendency to break a lot with various updates and was built with a million platforms connecting to it in-mind (props to HashiCorp for everything they achieved).
Vagrant hooks into multiple virtualization platforms, provisioning tools, works across multiple operating systems, and sometimes things just didn't mesh though. Debugging Vagrant was kind of a lift for people who aren't well equipped with Dev Ops, but when you did get it working, development was amazing!
That's why we made Scotch Box. A tool to allow you to use Vagrant - in all its glory - in the most stupid-easy way possible.
Table of Contents
Today, it has almost 2 million downloads! That's a crazy astronomical number that ended up being way bigger than ever predicted. In total, that's about 1250 terabytes of data downloaded from our servers.
If you're new to Scotch Box, I'll give you a complete introduction tutorial on it here, including Vagrant, and then cover some of the newer features and differences between the two boxes.
If you're not new to Vagrant, skip this section!
The simplest way to think about Vagrant is as a command line tool to control virtual box (or some other virtualization software). To get started:
Boom that's it! After you have that installed, open up your terminal and run:
If you get something like this you, know you're in the clear:BeginnerTailwind.com Learn Tailwind CSS from Scratch
Vagrant Boxes and the "Vagrantfile"
Vagrant doesn't really work on it's own though. It simply is just a tool that connects all the systems you need together (like Virtual Box software we just installed).
Think of Vagrant Boxes as pre-papackaged operating systems compressed into a
.box file. It's kind of like a
.iso file but just for Vagrant instead.
The Vagrantfile is literally a file named
Vagrantfile (no extension) that is pretty much your "config" on how you want vagrant to act. The Vagrantfile is:
- Written in Ruby
- Kind of crazy looking / complex if you don't know servers, networking, or Vagrant
Here's what a simple Vagrantfile might look like for example:
And, here's a crazy complex Vagrantfile for perspective on how far you can go with it:
Note: Complex doesn't mean awful though. That Vaprobash file is "badass" to it's core. It's just not for everyone.
Making them talk to each other and be friends
After you get to the Scotch Box tutorial below, this whole section might make more sense, but I want to cover it now. Vagrant has some commands you run from your terminal.
These commands need to be run from the folder location of the
Vagrantfile. When you run these commands it executes on the Vagrantfile.
The Vagrantfile then has a line in it saying to load whatever Vagrant box you want - Ubuntu, CentOS, Scotch Box, etc.
From the command line, you can do things like "use this vagrant box", "turn on vagrant box", "turn off vagrant box", etc.
Here they are:
# Use the box and/or turn the box back on vagrant up
# Turn the box off (similar to power off switch) vagrant halt
# Pause the box (similar to freezing it in time) vagrant suspend
# Turn the box off and stop using it vagrant destroy
# SSH into the box vagrant ssh
If you're not new to Scotch Box, skip this section!
Scotch Box is super easy to get up and running. Once you have installed Vagrant and VirtualBox, it's super quick!
Just clone and run
git clone https://github.com/scotch-io/scotch-box my-project cd my-project vagrant up
Then visit: http://192.168.33.10
That's it! Now if you ever need to run commands from within this new virtual server, just run:
Easy. As. Cake. From here, you can run all your other vagrant commands.
A while ago, the PPA's for the PHP version that Scotch Box became obsolete / broken:
This made it a pain to run updates or work with it. A lot of people in the Github issues found provisioning work-around for this, but we finally added the fix directly to the box by just upgrading to PHP v7.0.
That also included fixing a ton of other things that come with it like updating the PHP modules.
This makes Scotch Box Pro an absolute beast of a perfect and free development environment.
We updated the box.scotch.io website to be super clear on versions, features, and common GitHub help wanted questions. Hopefully it is now a way better resource.
New Landing Page
We also updated that page you land on with you first visit http://192.168.33.10. This reflects updates to the Box and adds some additional example code / tests.
We are still free / MIT License for the 3.0 version. The free version is still an awesome machine and will allow people to keep going strong without ever needing to upgrade.
The "Pro" version will help support the project, pay for expensive hosting bill, let you customize some things a bit more, and will help this project survive.
If you're super upset about this, in school, working for good causes, hurting for cash, email me at [email protected] so we can work something out.
I also kind of dropped off the map for 6 months busy with work/life. When Scotch Box desperately needed an update, I couldn't seem to get around to it. With Scotch Box Pro, it encourages people more to create their own boxes based off the build scripts for the box I provide in case that happens again. This way if I'm ever unavailable, people can fix, upgrade and do whatever the want!
Here's huge improvements:
- Ubuntu 16.04!
- PHP 7!
- MySQL 5.7!
- NGNIX Option!
- Go lang in the box
- PHPUnit in the box
- Improved email "catching" with MailHog
- Email "catching" is always on by default
- Vagrant Share working nicely finally
- The box's build scripts
- Customize your own boxes in minutes
- Generally higher versions of things (Node.js, Ruby, etc.)!
So let's talk about this!
Ubuntu 16.04, PHP 7.0, and MySQL 5.7
You get higher versions generally by default. It's nice to know you're working on a stable system.
For example, the free version uses a custom PPA to get PHP 7.0 working on the box, this one doesn't have to. Pretty nice and stable and just worked with
sudo apt-get install php.
This version also gets nicer / higher versions of things by with the higher operating system, such as MySQL 5.7!
We've finally released the bash script written to build "Scotch Box". The Pro version is provided with tutorials on how to use these and create your own custom box in minutes.
You could do neat things like:
- Customize the box's welcome message
- Change passwords / login
- Add, fix, adjust, change things to your liking
- Build off this for future projects (such as a production server)
- Help maintain the project / suggest improvements
NGINX is really awesome and I know a lot of people who prefer it. I still find Apache a little bit easier to work with, but there's a ton of people who feel differently.
I decided to take extra time and start providing an "NGINX flavor" that comes with the Pro version if you'd rather have that as your web server. It also depends on the project that you're working on.
Thank you for supporting our project. It has grown way larger than I could ever imagine and am glad it has helped so many people. Please check it out, support the project, and let us know if you have any questions!
Like this article? Follow @whatnicktweets on Twitter