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

fikri1510's avatar

What is the Best Practice to deploy Laravel on Server?

I have dedicated server to deploy laravel. What I did was to install git on the server and local, I pushed the code to github then on the server I cloned it. Whenever I have changed on my local, I type manually on the server by using nano. This required a lot of work and time consuming. Is there any good way to do it?I know there is envoyer, but it is not free. Thanks

0 likes
6 replies
wbarnard81's avatar

This is by no means the best practice, but why not push your changes to github and then just clone it again on your server?

fikri1510's avatar

@WBARNARD81 - That's what I am doing right now, but I am wondering if i have slightly changed in my code. Do I need to clone whole thing?

wbarnard81's avatar

Yeah, I have the same issue and am also looking for an easier alternative, but I do not think there is, as even with Heroku (and my express apps), I have to clone the repository after changes.

Apologies, maybe someone else can give you a better solution.

Edit: You can also use WinSCP to just upload the one file, that you have changed. Not sure if this is the solution you are looking for...

areddxx's avatar

There is a bit of varying advice in this thread, but this is pretty simple and should not be time consuming at all.

  1. Make your changes locally, ideally using branches for new updates etc.
  2. Push your changes to git
  3. SSH into your server
  4. Run git clone origin master.

Do not clone your repo again, do not ftp files, do not edit files directly on the server via nano aside from files in your gitignore.

This should only take you a couple minutes, one min to push and another to ssh and pull.

1 like

Please or to participate in this conversation.