🦍
Docs

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
  2. Download and Install VirtualBox

Just clone the repo and run vagrant up.

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

Then visit:

Vagrant Intro

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
                                                    

Access the Database


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:

Free Version

Pro Version


Summary

🤖 Feature 🙂 Free Version 😃 Pro Version
SSH Host 192.168.33.10 127.0.0.1
SSH User vagrant vagrant
SSH Password vagrant vagrant
SSH Port 22 2222
MySQL User root root
MySQL Password root root
MySQL Database scotchbox scotchbox

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".