2024-06-20 Mark Ivanowich
Assuming installing on Arch Linux, using an LTS kernel. In my case I'm using EndeavourOS.
First off, I want to install Laravel Homestead, which is built upon Vagrant, which requires a VM engine line VirtualBox.
I prefer to use one homestead box, and reconfigure the maps as I get a new project. As a consequence, running php7.4 and php8 on the same box SUUCKS. Which forces me to upgrade my sites at the earliest opportunity.
This includes packages that make virtualbox networking play nice.
sudo pacman -S virtualbox linux-lts-headers virtualbox-host-modules-arch net-tools virutalbox-guest-iso virtualbox-ext-vnc
Pacman will ask if you want virtualbox-host-dkms
or virtualbox-host-modules-arch
. For LTS, you need to use the former.
It is also recommended to reboot after installing as to load the virtualbox kernel drivers properly. Or run:
sudo modprobe vboxdrv
sudo pacman -S vagrant
git clone https://github.com/laravel/homestead.git ~/Projects/Homestead
Checkout the release branch, initalize:
cd ~/Homestead
git checkout release
bash init.sh
Configure Homestead to use Virtualbox:
# ~/Homestead/Homestead.yaml
provider: virtualbox
Some of my preferences:
features:
- mariadb: false
- postgresql: false
- ohmyzsh: true
- webdriver: false
- influxdb: false
services:
- enabled:
- "mysql"
Of course, configure the folder mappings, ports, sites, databases. Don't forget to update your /etc/hosts
file to point those test hostnames to 192.168.56.56
Since I use ZSH, I edit my .zshrc
file with a function to shortcut vagrant commands to this location:
function homestead() {
( cd ~/Projects/Homestead && vagrant $* )
}
function configure-homestead() {
( cd ~/Projects/Homestead && nano Homestead.yaml )
}
This way, I can run configure-homestead
from anywhere to configure, homestead up
to start my box, homestead ssh
to SSH, etc.
sudo pacman -S composer
This will install php8 if it is not already.
composer global require laravel/laravel
sudo pacman -S nodejs-lts-iron
Create a project with laravel create-project projectname
, configure-homestead
, and homestead up
Only thing missing is configuring an IDE. I need to read more into shared dotfiles...