SlideShare a Scribd company logo
Laravel Forge:
From Hello World to
Hello Production
https://joind.in/talk/42675
Joe Ferguson
Who Am I?
Joe Ferguson
PHP Developer
Twitter: @JoePFerguson
Organizer of @MemphisPHP
@NomadPHP Lightning Talks
PHP FIG Secretary
Passionate about Community
Step One: Hello World
Create our project
Via Laravel Installer: laravel new hello-world
Via Composer:
composer create-project laravel/laravel hello-world --prefer-dist
Where should our project live?
I prefer to keep things in ~/PhpstormProjects
Set up your dev environment
MAMP, LAMP, WAMP, WAT?
Mac/Linux/Windows Apache MySQL PHP
These are all great tools
Is your server running
MAMP?
Why not develop ON
the server?
Do not develop ON
the server
Develop in the same
environment
Servers are expensive*
* hardware is cheap, maintenance is expensive
Virtual Machines
are cheap
Our Use Case:
Duplicate our server environment
in a local virtual machine
Installing an OS takes time
Configuring your stack takes time
What if I told you…
There was a better way
Vagrant!
Vagrant allows you to:
•Create a server
•Configure a server
•Delete a server
…over and over and over..
Vagrant consumes the API of
Virtualbox and other VM providers
Which Vagrant?
atlas.hashicorp.com
Laravel Homestead
“Laravel Homestead is an official, pre-packaged
Vagrant "box" that provides you a wonderful
development environment without requiring
you to install PHP, HHVM, a web server, and
any other server software on your local machine.”
But I need…
What’s in the box:
•Ubuntu 14.04
•PHP 5.6
•HHVM
•Nginx
•MySQL & MariaDB
•Postgres
•Redis
•NodeJS
•Bower
•Grunt
•Gulp
•Beanstalkd
•Memcached
•Laravel Envoy
Fabric + HipChat Extension + more!
Getting Homestead
Install the box:
vagrant box add laravel/homestead
Clone the Repository:
git clone https://github.com/laravel/homestead.git Homestead
Configure Homestead
Default: Hello World:
Update /etc/hosts
192.168.10.10 hello-world.app
Ready to vagrant up
Our code will be shared from our host machine
And mapped to the vagrant machine
~/PhpstormProjects/hello-world
/home/vagrant/hello-world
How I use Homestead
Install Homestead
http://laravel.com/docs/5.1/homestead#per-project-installation
$ vagrant up
Why do I prefer per-project?
Sharing your Homestead environment
Do not version control:
Homestead.yml
DO version control:
Vagrantfile
after.sh
aliases
you should instruct potential collaborators to run the
make command for themselves
What now?
How to access hello-world.app
These are ports forwarded to homestead
Connect to the Database
Connect via a browser
Connect via SSH
You could do this:
But this is easier:
Homestead is awesome!
We now have a local dev environment
we can easily use, break, and restore
without having to reinstall the
entire operating system and developer tools.
Break something?
Staking your own Homestead
I like to customize homestead
AND
make sure I can easily update from upstream
Fork Homestead
Update your Homestead
Use after.sh for extras
./vendor/bin/homestead make —after
What could after.sh do?
You may not need after.sh
It is important to have a way to easily
reproduce your development environment
so that those one off changes you make
are documented and two months down the
road you don’t destroy & up your environment
to find out you have stuff missing
Step ???
Go make something great
Tests!
You've written tests all along for your app right?
PHPUnit isn’t the only option!
•Behat
•phpspec
•Codeception
Codeception
• Selenium WebDriver integration
• Elements matched by name, CSS, XPath
• Symfony2, Laravel4, Yii, Phalcon,
• Zend Framework integration
• PageObjects and StepObjects included
• BDD-style readable tests
• Powered by PHPUnit
• API testing: REST,SOAP,XML-RPC
• Facebook API testing
• Data Cleanup
• HTML, XML, TAP, JSON reports
• CodeCoverage and Remote CodeCoverage
• Parallel Execution
Codeception.com
Unit Testing
• Our methods work
Functional Testing
• Our product works
Acceptance Testing
• Our product works
as intended
PhantomJS
PhantomJS is a headless WebKit scriptable
with a JavaScript API.
It has fast and native support for various
web standards: DOM handling,
CSS selector, JSON, Canvas, and SVG.
Codeception + PhantomJS
Basic Acceptance Test
Automate our Testing
Travis-CI
•Great for OSS projects (And free!)
•Easy to set up
•Easily test multiple versions of PHP
•Hosted on Travis Servers
.travis.yml
Jenkins CI
•Easy To Install
•Easy Configuration
•Multiple Languages
•Probably Overkill for PHP
•Hosted on your servers
TeamCity
•Easy To Install
•Easy Configuration
•Multiple Languages
•Nice middle ground
•Hosted on your servers
TeamCity
Build Config
Build Steps
Edit Build Step
Step Three:
Hello Production
Traditional Deployment
Better Deployment
But you still have to…
•Update Dependencies
•Run migrations
•Update Assets
Continuous Delivery
Production can be updated anytime
Continuous Delivery
VS
Continuous Deployment
Continuous Deployment
“Deploy my code every time tests pass”
Continuous Delivery
“We can deploy whenever we want…but we control when”
Magnus Hedemark: http://puppetlabs.com/blog/continuous-delivery-vs-continuous-deployment-whats-diff
Laravel Forge
“A simple way to deploy your Laravel applications
onto blazing fast servers”
Forge is Homestead
and more in the cloud
Forge is not a server host
Forge uses your servers
Forge uses any* server
*Any Internet accesible Ubuntu 14.04 x64 Server
Laravel Forge
• Unlimited Servers.
• Unlimited Sites.
• Unlimited Deployments.
• Push To Deploy.
Laravel Forge Plus
• Share Servers With Teammates.
• Unlimited Servers.
• Unlimited Sites.
• Unlimited Deployments.
• Push To Deploy.
$10/Month
$100/Year
$20/Month
$140/Year
Adding Servers To Forge
Adding a site to a server
Adding a ssh key to a server
Adding scheduled (cron) jobs
Adding daemons (supervisor)
Creating server networks
Server Monitoring
Update Server Meta Data
Adding our hello-world site
Install our Git Repository
Configure App Deployment
Deploy!
Deploy!
Continuous
Delivery!
Deployment Log
Setting Environment Variables
Queue Workers
Configure / Install SSL
LetsEncrypt.org
100% Supported
Enable Quick Deploy
Quick Deploy Branch
Quick Deploy Branch
Continuous
Deployment!
Recipes
Recipes a bash scripts that can be
run on any of your Forge servers.
Cooking up Recipes
Think of recipes like our after.sh in Homestead
All the things!
Not All The Things
Some things we were doing in customize.sh
we can do via Forge:
•Queue Workers
•Cron Jobs
Create Recipe
Run Install Bower Recipe
Forge Emails You Recipe Report
HipChat Notifications
Slack Notifications
Restarting Services
Edit PHP Configuration
Delete the server
Deleting a site
Envoyer.io
Zero Downtime
Deployments with
Envoyer.io
Envoyer
10 Projects - $10/month or $100/year
20 Projects - $20/month or $200/year
Envoyer Plus
Unlimited Projects - $50/month or $500/year
Envoyer Premium
Add a project
Adding a Server
Add the SSH key from
Envoyer
Test Connection Status
Envoyer now connected to our Forge Server
Project Path
Our first Deployment
Deployment Recap
Deploy when code is pushed
Free Video Series at Laracasts
https://laracasts.com/series/envoyer
https://envoyer.io/docs
Recap
Local Development: Use Homestead
Remote Deployment: Use Forge and Envoyer
Automate built tests and configure
Continuous Deployment
Practice Continuous Delivery if not Continuous Deployment
Feedback!
Joe Ferguson
Twitter: @JoePFerguson
Email: joe@joeferguson.me
Freenode: joepferguson
Contact Info:
https://joind.in/talk/42675

More Related Content

What's hot (20)

PDF
Laravel Forge: Hello World to Hello Production
Joe Ferguson
 
PDF
Console Apps: php artisan forthe:win
Joe Ferguson
 
PPTX
Laravel 5
Brian Feaver
 
PDF
Knowing Laravel 5 : The most popular PHP framework
Bukhori Aqid
 
PPTX
Intro to Laravel
Azukisoft Pte Ltd
 
PPTX
10 Laravel packages everyone should know
Povilas Korop
 
PDF
Laravel 5.4
Nisha Patel
 
PPTX
Selenium for Jobseekers
Seshu Madhav Chaturvedula
 
PDF
30 Skills to Master to Become a Senior Software Engineer
Sean Coates
 
PDF
From CakePHP to Laravel
Jason McCreary
 
PPT
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Lorvent56
 
PDF
vJUG - The JavaFX Ecosystem
Andres Almiray
 
PDF
DevOps叢林裡的小隊游擊戰術 (@ iThome DevOps 2015)
Chen Cheng-Wei
 
PDF
Spring Boot
Jaran Flaath
 
PDF
Composer at Scale, Release and Dependency Management
Joe Ferguson
 
PDF
Put an end to regression with codeception testing
Joe Ferguson
 
PDF
How To Use Selenium Successfully (Java Edition)
Dave Haeffner
 
PDF
Selenium RC: Automated Testing of Modern Web Applications
qooxdoo
 
PPTX
Test automation with php codeception
buddhieash
 
Laravel Forge: Hello World to Hello Production
Joe Ferguson
 
Console Apps: php artisan forthe:win
Joe Ferguson
 
Laravel 5
Brian Feaver
 
Knowing Laravel 5 : The most popular PHP framework
Bukhori Aqid
 
Intro to Laravel
Azukisoft Pte Ltd
 
10 Laravel packages everyone should know
Povilas Korop
 
Laravel 5.4
Nisha Patel
 
Selenium for Jobseekers
Seshu Madhav Chaturvedula
 
30 Skills to Master to Become a Senior Software Engineer
Sean Coates
 
From CakePHP to Laravel
Jason McCreary
 
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Lorvent56
 
vJUG - The JavaFX Ecosystem
Andres Almiray
 
DevOps叢林裡的小隊游擊戰術 (@ iThome DevOps 2015)
Chen Cheng-Wei
 
Spring Boot
Jaran Flaath
 
Composer at Scale, Release and Dependency Management
Joe Ferguson
 
Put an end to regression with codeception testing
Joe Ferguson
 
How To Use Selenium Successfully (Java Edition)
Dave Haeffner
 
Selenium RC: Automated Testing of Modern Web Applications
qooxdoo
 
Test automation with php codeception
buddhieash
 

Similar to Laravel Forge: Hello World to Hello Production (20)

PDF
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
Joe Ferguson
 
PDF
php[world] 2015 Training - Laravel from the Ground Up
Joe Ferguson
 
PDF
Developing web apps
Michael Dyrynda
 
PDF
ZendCon 2015 - DevOps for Small Teams
Joe Ferguson
 
PDF
Madison PHP 2015 - DevOps For Small Teams
Joe Ferguson
 
PDF
Converting Your Dev Environment to a Docker Stack - php[world]
Dana Luther
 
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
PDF
Take Home Your Very Own Free Vagrant CFML Dev Environment
ColdFusionConference
 
PDF
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Gavin Pickin
 
PDF
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
PPTX
Using vagrant
Cuong Huynh
 
PDF
Converting Your Dev Environment to a Docker Stack - Cascadia
Dana Luther
 
PDF
Vagrant - Version control your dev environment
bocribbz
 
PDF
Convert Your Dev Environment to a Docker Stack - PHP Tek 2025.pdf
Dana Luther
 
PDF
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky
 
PPTX
Lumen
Joshua Copeland
 
PPTX
Laravel introduction
Simon Funk
 
PPTX
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
E. Camden Fisher
 
PPTX
Develop with docker 2014 aug
Vincent De Smet
 
PPTX
Vagrant-Overview
Crifkin
 
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
Joe Ferguson
 
php[world] 2015 Training - Laravel from the Ground Up
Joe Ferguson
 
Developing web apps
Michael Dyrynda
 
ZendCon 2015 - DevOps for Small Teams
Joe Ferguson
 
Madison PHP 2015 - DevOps For Small Teams
Joe Ferguson
 
Converting Your Dev Environment to a Docker Stack - php[world]
Dana Luther
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
ColdFusionConference
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Gavin Pickin
 
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
Using vagrant
Cuong Huynh
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Dana Luther
 
Vagrant - Version control your dev environment
bocribbz
 
Convert Your Dev Environment to a Docker Stack - PHP Tek 2025.pdf
Dana Luther
 
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky
 
Laravel introduction
Simon Funk
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
E. Camden Fisher
 
Develop with docker 2014 aug
Vincent De Smet
 
Vagrant-Overview
Crifkin
 
Ad

More from Joe Ferguson (15)

PDF
Modern infrastructure as code with ansible cake fest 2021
Joe Ferguson
 
PDF
Modern infrastructure as code with ansible PyTN
Joe Ferguson
 
PDF
Slim PHP when you don't need the kitchen sink
Joe Ferguson
 
PDF
Throwing Laravel into your Legacy App™
Joe Ferguson
 
PDF
DevSpace Conf 2017 - Making sense of the provisioning circus
Joe Ferguson
 
PDF
Release and-dependency-management memphis python
Joe Ferguson
 
PDF
Console Apps: php artisan forthe:win
Joe Ferguson
 
PDF
So You Just Inherited a $Legacy Application… NomadPHP July 2016
Joe Ferguson
 
PDF
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Joe Ferguson
 
PDF
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Joe Ferguson
 
PDF
Secure Form Processing and Protection - Devspace 2015
Joe Ferguson
 
PDF
Acceptance & Functional Testing with Codeception - Devspace 2015
Joe Ferguson
 
PDF
Continuous Integration: How I stopped guessing if that merge was bad
Joe Ferguson
 
PDF
DevOps For Small Teams
Joe Ferguson
 
PDF
Secure Form Processing and Protection - Sunshine PHP 2015
Joe Ferguson
 
Modern infrastructure as code with ansible cake fest 2021
Joe Ferguson
 
Modern infrastructure as code with ansible PyTN
Joe Ferguson
 
Slim PHP when you don't need the kitchen sink
Joe Ferguson
 
Throwing Laravel into your Legacy App™
Joe Ferguson
 
DevSpace Conf 2017 - Making sense of the provisioning circus
Joe Ferguson
 
Release and-dependency-management memphis python
Joe Ferguson
 
Console Apps: php artisan forthe:win
Joe Ferguson
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
Joe Ferguson
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Joe Ferguson
 
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Joe Ferguson
 
Secure Form Processing and Protection - Devspace 2015
Joe Ferguson
 
Acceptance & Functional Testing with Codeception - Devspace 2015
Joe Ferguson
 
Continuous Integration: How I stopped guessing if that merge was bad
Joe Ferguson
 
DevOps For Small Teams
Joe Ferguson
 
Secure Form Processing and Protection - Sunshine PHP 2015
Joe Ferguson
 
Ad

Recently uploaded (20)

PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
[GDGoC FPTU] Spring 2025 Summary Slidess
minhtrietgect
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PPTX
Wondershare Filmora Crack Free Download 2025
josanj305
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Survival Models: Proper Scoring Rule and Stochastic Optimization with Competi...
Paris Women in Machine Learning and Data Science
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Digital Circuits, important subject in CS
contactparinay1
 
[GDGoC FPTU] Spring 2025 Summary Slidess
minhtrietgect
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
Wondershare Filmora Crack Free Download 2025
josanj305
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Survival Models: Proper Scoring Rule and Stochastic Optimization with Competi...
Paris Women in Machine Learning and Data Science
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 

Laravel Forge: Hello World to Hello Production