Laravel Homestead Creation

Published on Author craigzearfossLeave a comment

Homestead Includes:

  • Ubuntu 14.04
  • PHP 5.6
  • HHVM
  • Nginx
  • MySQL
  • Postgres
  • Node (with Bower, Grunt, and Gulp)
  • Redis
  • Memcached
  • Beanstalkd
  • Laravel Envoy
  • Fabric + HipChat Extension

  • Before you begin.
    • Install Composer. See Installing Composer on Ubuntu.
    • Create a Laravel project.
    • composer create-project laravel/laravel PROJECT_NAME --prefer-dist
      
  • Download VirtualBox from https://www.virtualbox.org/wiki/Downloads and install. (Make sure you select the right package.)

    sudo dpkg -i virtualbox-5.0_5.0.14-105127~Ubuntu~trusty_amd64.deb
    
  • Download Vagrant from https://www.vagrantup.com/ and install. (Make sure you select the right package.)

    sudo dpkg -i vagrant_1.8.1_x86_64.deb
    
  • Add Laravel Homestead’s Vagrant box. (cd noto your project directory first.)

    vagrant box add laravel/homestead
    
  • Install Laravel Homestead through Composer globally.

    composer global require "laravel/homestead=~2.0"
    
  • You should now be able to run the homestead command. If you cannot, you will need to update your path in your.bashrc file. Do this with the following command.

    export PATH="~/.composer/vendor/bin:$PATH"
    

    * You will need to open a new terminal tab for the change to take effect.

  • Create the Homestead global configuration file.

    homestead init
    
  • Modify the Homestead configuration file Homestead.yaml as needed.

    homestead edit
    
  • Start up your virtual machine. (This may take 5 to 20 seconds.)

    homestead up
    
  • ssh into you Homestead virtual machine.

    homestead ssh
    
  • Start your server.

    serve DOMAIN_NAME PATH_TO_PUBLIC_DIRECTORY
    
  • Add DOMAIN_NAME to your /etc/hosts file.
  • In you browser navigate to the page http://DOMAIN _NAME.

References:

Leave a Reply

Your email address will not be published. Required fields are marked *