8. No More
● “It works on my machine”
● I can’t install that on my shared host
● Do they have that on Xampp?
● Do they have that package for my operating
system?
9. But… but…
...there’s port, homebrew, heroku
Yeah that’s true. But let me enlighten
you.
10. Can port do this?
Strap a squirrel to a rocket ship and launch it to
Greenland?
11. Vagrant can’t do that
either BUT it can:
● create a base Linux server using your favorite flavor
(Ubuntu, CentOS, Debian, others)
● run set-up scripts (provisioning scripts)
● set up port forwarding
● allow tinkering with anything linux related, breaking it,
destroying it, and starting from scratch again
● and much much more for an easy payment of...
A few lines of Ruby code and some shell commands
12. More Reasons
● try things that will break your production
server without the heart attacks
● having a virtualized server locally can be
much faster and convenient for development
● it’s the closest thing to your actual production
server so dev/prod parity is much more
realistic
13. Vagrant is Digital
Nomad Friendly
No Internet or sucky connection, No problem.
14. Staging Server vs Vagrant
Vagrant is just another VPS living inside of your computer.
So you could treat it as such.
● VirtualHosts
● SSH
● SSL
● Node.js, Python, Ruby, Clojure, Nginx, whatever
16. CentOS, PHP 5.6,
Apache, and Working
Dev Environment in
under 10 minutes
17. $ vagrant init chef/centos-6.5
A `Vagrantfile` has been placed in this directory. You
are now
ready to `vagrant up` your first virtual environment!
Please read
the comments in the Vagrantfile as well as
documentation on
`vagrantup.com` for more information on using Vagrant.
$ vagrant up
$ vagrant ssh
19. # make sure httpd is started after a restart
$ chkconfig httpd on
$ service iptables stop # turn off firewall (dev)
$ exit
$ exit
# now we’re back on our host machine
$ vim Vagrantfile
# uncomment config.vm.network "forwarded_port", guest: 80,
host: 8080
# change the host port to something else if it conflicts
$ vagrant reload
$ curl localhost:8080
hello
23. Other cool features
● sharing your environment and exposing it
with a url to a co-worker/friend/evil h4x0r
with vagrant connect
● spooling up AWS/DigitalOcean/Rackspace
instances
● using configuration management packages
like puppet, chef, and ansible
● creating your own base box