Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

balimaco00's avatar

How to deploy laravel on OVH perso

Hi everyone; I have an internship this summer and I want to deploy my web application using laravel in a website so that my teacher can see it how can I do it in OVH ? I have a personnal account wich gives me this functions : https://www.ovh.com/ma/hebergement-web/hebergement-perso.xml

if this offer doesn't give me better place to deploy it, how can I do it freely ? Thank you for your help

0 likes
5 replies
JohnRivs's avatar
Level 37

If that's a VPS (like Digitalocean for example), you can do it the old fashioned way using FTP or you can set up the repo in your server.

To emulate what platforms like heroku and stuff like that do, I create an empty bare repo. Let's say your app is served from /home/www/app. You'd have /home/www/repo/app.git, cd into it, git init --bare and add the the url to that path to your remote branch in your local app (for example ssh://nameOfTheUser@yourDomainOrIP.com/home/www/repo/app.git).

Then you set up a hook to copy the app to /home/www/app after every push. So go to /home/www/repo/app.git/hooks and create a file called post-receive:

#!/bin/sh
git --work-tree=/home/www/app --git-dir=/home/www/repo/app.git checkout -f

If you need to add any other command, like composer install, add it to the file; a command per line.

Make it executable: chmod -x /home/www/repo/app.git/hooks/post-receive.

A variation of this would be, to cd /home/www/app and pull the changes.

balimaco00's avatar

Thank you for your answer I tried the old fashionned way using FTP but it didn't work for me (I put the folder laravel in www, and went to mywebsite.com/laravel/public , but I see a blank page without any message can you guess what's the problem ? )

Thank you for suggesting Heroku it worked for me, but I wish I can use my personal website

Blast06's avatar

bad service?(i was close to get it until i see your comment lol) im looking for a good vps, what do you think of Digital Ocean? but im really looking for an alternative to DO

Please or to participate in this conversation.