How To Install Laravel Locally On A Mac

So You Can Install Survloop

 I have only been learning Laravel for a year, but below is the Homestead install process which has worked best for me. Homestead is Laravel's own development environment, powered by Vagrant.

Replace all references to "ProjectName" with a short name for your own project.

  1. Install XCode from the App Store. Open it, and accept the user agreement.
  2. Install VirtualBox:
  3. Install Vagrant:
  4. To the command line (Mac OS Terminal, or iTerm)! Create local ssh key, if you haven't on this computer before:
    $ ssh-keygen -t rsa -C ""
  5. Install Composer, Homestead, and initialize. For this example, the work area's directory is "~/web", and the project folder is installed to "ProjectName", but you can adjust those as needed:
    $ vagrant box add laravel/homestead
    $ curl -sS | sudo php -- --install-dir=/usr/local/bin --filename=composer $ mkdir ~/web $ cd ~/web $ git clone ProjectName
    $ git checkout release $ cd ProjectName $ bash


  6. Edit paths in Homestead.yaml:
    $ nano Homestead.yaml
    Change the folders and sites to:
    	- map: ~/web/ProjectName/code
    	  to: /home/vagrant/code
        - map: survloop.local
          to: /home/vagrant/code/ProjectName/public


  7. Edit the hosts file:
    $ sudo nano /etc/hosts
    Add one line to the bottom:   homestead.local


  8. Launch your local server ("vagrant up"), log into it, and install Laravel!...
    $ cd ~/web/ProjectName
    $ vagrant up
    $ vagrant ssh
    $ cd /home/vagrant/Code
    $ composer global require "laravel/installer"
    $ composer create-project laravel/laravel ProjectName "5.8.*"


Now you should be able to confirm your successful installation by pulling up http://homestead.local in your browser!

  • If you like, you can now connect to your server's database with something like Sequel Pro, and the following default login info.... Host: , Username: homestead , Password: secret , Port: 33060 , Database: homestead .


And you're ready to start installing more Laravel packages and building your own world. Here, inside your virtual vagrant server via SSH, you can enter your new project's main composer directory (/home/vagrant/code/ProjectName), which displays in your actual machine's file system in ~/web/ProjectName/code/ProjectName (that's within your main user account folder alongside Documents, Pictures, etc).
$ cd ProjectName


Edit the environment file to connect the database:

$ nano .env



You could do things like install Laravel's out-of-the-box user authentication tools:
$ php artisan make:auth

Or install the Survloop software I've started:

Or anything else you can imagine:


How to install Survloop (after installing Laravel)