How to install Homestead in Ubuntu

There are some more general instructions to be found at https://laravel.com/docs/5.8/homestead

There are the following steps steps:

  1. Install Vagrant, Virtualbox and Homestead
  2. Edit config files: `/etc/hosts/` and `Homestead.yaml`
  3. Run vagrant
  4. Add phpMyAdmin

Note: Its said at https://laravel.com/docs/5.8/homestead#first-steps

Before launching your Homestead environment, you must install VirtualBox 6.x, VMWare, Parallels or Hyper-V as well as Vagrant.

This means you only have to install one of the four :VirtualBox 6.x, VMWare, Parallels or Hyper-V

1. Install Vagrant, Virtualbox and Homestead

First install Vagrant:
Download Debian File: https://www.vagrantup.com/downloads.html you can simply install it with package manager or like explained here: https://askubuntu.com/a/995646/247771

Then install VirtualBox https://www.virtualbox.org (its really just download and double click)

clone homestead into some folder, for example ~/Programs/ by

cd ~/Programs
git clone https://github.com/laravel/homestead.git ~/Homestead

2. edit config files

Get IP from Homestead.yaml file(in my case it is 192.168.10.10)

Edit '/etc/hosts' file and add each domain that you want to use

 192.168.10.10 mypage.test
192.168.10.10 my2ndpage.test
192.168.10.10 my3rdpage.test

Note: ' .dev' domains will not work anymore in Firefox and Chrome

Now edit your ' Homestad.yaml' file.

Imagine you have your app in the folder ~/www/homestead/memberportal/ then change ' Homestad.yaml' as this:

folders:
 - map: ~/www/homestead # Path on my pc
    to: /home/vagrant/projects #Path of VM
sites:
 - map: member.test
    to: /home/vagrant/projects/memberportal/public #path of VM

Whenever you want to change something in yur ' Homestead.yaml' file you need to call

vagrant reload –provision

3. Run vagrant

Go into the homestead folder and call

vagrant up

you may also log into your machine by

vagrant ssh

You also may change your .bashrc on your local machine so you will always land in correct folder:

vagrant up
vagrant ssh
cd
sudo vim .bashrc
//add
cd ../www/memberportal/
//or whatever youw want

4. Add phpMyAdmin

Download latest version: https://www.phpmyadmin.net/

Unzip in your working directory, e.g. 'www/homestead'

Update homestead.yaml and hosts file like this:

homestead.yaml

sites:
 map: phpmyadmin.test
 to: /home/vagrant/Code/phpMyAdmin 

Open your hosts file and add this line:

192.168.10.10 phpmyadmin.test

run

vagrant reload –provision

Enter in your browser 'phpmyadmin.test' to access it

Note: If you got the error "No input file specified" 
this seems to point out that your map path is incorrect. 
Maybe it is /home/vagrant/Code/phpmyadmin instead of
/home/vagrant/Code/phpMyAdmin or something

Leave a comment

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