SlideShare a Scribd company logo
Laravel Forge: 
From Hello World to Hello Production
Step One: Hello World 
Step Two: CI, CD, OMG 
Step Three: ???? 
Step Four: Hello 
Production
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
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
Virtual Machines are 
cheap
Our Use Case: 
Duplicate our server environment 
in a local virtual machine
Installing an OS takes time
Vagrant!
Vagrant allows you to: 
• Create a server 
• Configure a server 
• Delete a server 
…over and over and over..
Which Vagrant?
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 
• 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 
*This step is optional
Ready to vagrant up 
Our code will be shared from our host machine 
~/PhpstormProjects/hello-world 
And mapped to the vagrant machine 
/home/vagrant/hello-world
$ vagrant up
What now?
How to access our 
hello-world.app 
These are ports forwarded to homestead
Connect to the Database
Connect via a browser
Or use the hostname* 
*If you added the host to your /etc/hosts
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
Add another provisioner
What could customize.sh do?
You may not need 
customize.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 
• 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
Basic Acceptance Test
Automate our Testing
TeamCity
Build Steps
All OK? Deploy!
Step Four: 
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
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
Forge can do more…
Add a WordPress Site
Ready to install
Removing WordPress 
Does NOT remove your WordPress Database!
Install Craft CMS
Craft CMS
Uninstall Craft CMS 
Does NOT remove your Craft CMS Database!
Install our Git Repository
Configure App Deployment
Deploy!
Deploy! 
Continuous 
Delivery!
Deployment Log
Setting Environment 
Variables
Queue Workers
Configure / Install SSL
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 customize.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 
You can use cURL to post to Slack channels 
curl -X POST --data-urlencode ‘payload= 
{"channel": “#devops", 
"username": "Forge", 
"text": “'"$Message"'", 
"icon_emoji": ":shipit:"}' 
https://<You>.slack.com/services/ 
hooks/incoming-webhook 
?token=<Your-Slack-Token>
Edit our Deployment 
Script 
Now every deployment will run bower and 
notify our slack channel that our repo was deployed.
Hey Joe…
Been there, done that
Enable Slack
Add the Integration
Authenticate with Slack
Deploy!
Restarting Services 
Edit PHP Configuration
Delete the server
Deleting a site
Forge Circles* 
*Forge Plus Feature
Forge Circles* 
*Forge Plus Feature
Forge VS Forge Plus 
• Manage 5 Servers 
• Unlimited Servers 
• Forge Circles
Recap 
Local Development: Use Homestead 
Automate build tests and configure 
Continuous Deployment 
Practice Continuous Delivery if not Continuous Deployment 
Remote Deployment: Use Forge
Feedback! 
https://joind.in/talk/view/11870 
Contact Info: 
Joe Ferguson 
Twitter: @Svpernova09 
Email: joe@joeferguson.me

More Related Content

PDF
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
PPTX
Laravel Beginners Tutorial 1
PDF
php[world] 2015 Training - Laravel from the Ground Up
PPTX
Laravel for Web Artisans
PPTX
Intro to Laravel
PDF
All the Laravel things: up and running to making $$
PDF
Intro to Laravel 4
PDF
Getting to know Laravel 5
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
Laravel Beginners Tutorial 1
php[world] 2015 Training - Laravel from the Ground Up
Laravel for Web Artisans
Intro to Laravel
All the Laravel things: up and running to making $$
Intro to Laravel 4
Getting to know Laravel 5

What's hot (20)

PPTX
10 Laravel packages everyone should know
PDF
MidwestPHP 2016 - Adventures in Laravel 5
PDF
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
PPT
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
ODP
Presentation laravel 5 4
PPTX
Workshop Laravel 5.2
PPTX
Laravel Beginners Tutorial 2
PDF
Why Laravel?
PPTX
Introduction to Laravel Framework (5.2)
PDF
Laravel 5 New Features
PDF
What's New In Laravel 5
PDF
Laravel 5.4
PPTX
Laravel - Website Development in Php Framework.
PDF
Laravel Forge: Hello World to Hello Production
PDF
Laravel 5 Annotations: RESTful API routing
PDF
Knowing Laravel 5 : The most popular PHP framework
PDF
Deploying Symfony | symfony.cat
PDF
Web Development with Laravel 5
PDF
Laravel 101
PPTX
A introduction to Laravel framework
10 Laravel packages everyone should know
MidwestPHP 2016 - Adventures in Laravel 5
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Presentation laravel 5 4
Workshop Laravel 5.2
Laravel Beginners Tutorial 2
Why Laravel?
Introduction to Laravel Framework (5.2)
Laravel 5 New Features
What's New In Laravel 5
Laravel 5.4
Laravel - Website Development in Php Framework.
Laravel Forge: Hello World to Hello Production
Laravel 5 Annotations: RESTful API routing
Knowing Laravel 5 : The most popular PHP framework
Deploying Symfony | symfony.cat
Web Development with Laravel 5
Laravel 101
A introduction to Laravel framework
Ad

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

PDF
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
PDF
All the Laravel Things – Up & Running to Making $$
PDF
Midwest PHP 2017 DevOps For Small team
PDF
Developing web apps
PDF
Continuous Delivery: The Next Frontier
PDF
Dockerize Laravel Application
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
PDF
Docker at MoneyBird
PPTX
Laravel Day / Deploy
PDF
Converting Your Dev Environment to a Docker Stack - php[world]
PDF
ZendCon 2015 - DevOps for Small Teams
PDF
Madison PHP 2015 - DevOps For Small Teams
PDF
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
PPT
Professional deployment
PDF
Take Home Your Very Own Free Vagrant CFML Dev Environment
PDF
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
PPTX
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
PDF
Cooking Perl with Chef: Hello World Tutorial
PDF
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
PDF
Convert Your Dev Environment to a Docker Stack - PHP Tek 2025.pdf
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
All the Laravel Things – Up & Running to Making $$
Midwest PHP 2017 DevOps For Small team
Developing web apps
Continuous Delivery: The Next Frontier
Dockerize Laravel Application
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Docker at MoneyBird
Laravel Day / Deploy
Converting Your Dev Environment to a Docker Stack - php[world]
ZendCon 2015 - DevOps for Small Teams
Madison PHP 2015 - DevOps For Small Teams
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Professional deployment
Take Home Your Very Own Free Vagrant CFML Dev Environment
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
Cooking Perl with Chef: Hello World Tutorial
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
Convert Your Dev Environment to a Docker Stack - PHP Tek 2025.pdf
Ad

More from Joe Ferguson (18)

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

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Spectroscopy.pptx food analysis technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
A comparative analysis of optical character recognition models for extracting...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Approach and Philosophy of On baking technology
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Machine learning based COVID-19 study performance prediction
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPT
Teaching material agriculture food technology
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation theory and applications.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Encapsulation_ Review paper, used for researhc scholars
Assigned Numbers - 2025 - Bluetooth® Document
Spectroscopy.pptx food analysis technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
A comparative analysis of optical character recognition models for extracting...
“AI and Expert System Decision Support & Business Intelligence Systems”
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Approach and Philosophy of On baking technology
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Machine learning based COVID-19 study performance prediction
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Teaching material agriculture food technology
SOPHOS-XG Firewall Administrator PPT.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Laravel Forge: Hello World to Hello Production