Search This Blog

2017/10/31

Set up laravel Homestead by vagrant

Prepare installation: VirtualBox 5.1; Vagrant; composer

$ vagrant box add laravel/homestead

$ cd ~

$ cd Homestead
$ git checkout v6.5.0

Init homestead
// Mac / Linux...
$ bash init.sh
// Windows...
$ init.bat

Modify file "Homestead.yaml"
folders:
    - map: /the/path/in/pc
      to: /home/vagrant/code

$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
$ eval "$(ssh-agent -s)"
$ ssh-add -k ~/.ssh/id_rsa

$ cd /the/path/in/pc
$ composer create-project laravel/laravel projectName

Init and set up vagrant
$ vagrant up

Stop vagrant
$ vagrant halt

Connect to vagrant env
$ vagrant ssh

Restart vagrant
$ vagrant reload

1 comment :