How to host a Laravel project on Gandi

(Click here to try Gandi Simple Hosting with 6 months free hosting)

I host a lot of my projects on Gandi.net hosting, and when I started using the Laravel PHP web framework, it wasn’t obvious at first how to run a Laravel project on Gandi Simple Hosting. So let me describe the way I do it.

1. “Deploy with git” websites

git add .
git commit -a -m "first commit"
gandi paas console [yourserver]
cd vhosts/app.example.com/
mv htdocs htdocs_old

2. “Deploy with git” bash script

UPDATE: I upgraded this simple deploy script into a better gandi_deploy script: Easy site deployment on Gandi with git and gdeploy

To make re-deploying the project easier, I use a simple redeploy.sh bash script:

#!/bin/sh
   git commit -a \
&& git push gandi master \
&& ssh <yourid>@git.sd6.gpaas.net deploy app.example.com.git

Be sure to add your public key id_rsa.pub to the Gandi SSH key list, so you won’t have to give a password for the git push and ssh deploy step.

3. “Update via sFTP” websites

Also check out the gandi-deploy / gdeploy.sh script for even easier deployment and administration

💬 devops 🏷 gandi 🏷 hosting 🏷 laravel 🏷 github 🏷 php