Skip to content

Instantly share code, notes, and snippets.

@MarkIvanowich
Last active June 21, 2024 00:46
Show Gist options
  • Save MarkIvanowich/2c049d3af6042a97af9431bf88f9d092 to your computer and use it in GitHub Desktop.
Save MarkIvanowich/2c049d3af6042a97af9431bf88f9d092 to your computer and use it in GitHub Desktop.
Laravel Setup Checklist

Laravel Setup Checklist (For Linux!)

2024-06-20 Mark Ivanowich

Assuming installing on Arch Linux, using an LTS kernel. In my case I'm using EndeavourOS.

Install Homestead (Vagrant, Virtualbox)

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.

[ ] Install Virtualbox with accompanying packages:

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

[ ] Install vagrant

sudo pacman -S vagrant

[ ] Configure a place for homestead to live

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.

Back to the base packages

[ ] Install composer

sudo pacman -S composer

This will install php8 if it is not already.

[ ] Install the laravel/laravel composer installer package globally:

composer global require laravel/laravel

[ ] Install the latest LTS version of nodejs, npm

sudo pacman -S nodejs-lts-iron

Theoretically, you're good to go

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment