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

lonelearner's avatar

Deploying to a VPS

Can anyone please point me in the direction of a guide on how to deploy a Laravel app to a VPS?

Edit: I can already setup VPS with LAMP stack and deploy directly to server with git. However, with Laravel, I believe there are other things to be done here and there (switching environments, cache, etc) after the files have been moved to the VPS.

I plan on using Laravel Forge in the future for convenience, but for now, I really want to know what happens under the hood when an app is deployed.

0 likes
3 replies
sr57's avatar

Without docker :

Install OS utilities, Web server, Php, DB server, Node, Laravel and then put your app.

1 like
Ap3twe's avatar
Ap3twe
Best Answer
Level 5

Use git to do it. Is simple and easy Just select the domain and under "Dev Tools" there's a Git option (should show enabled or disabled). Obviously you need to enable it, set up the auth key for GitHub etc. and pull your repo into the correct folder.

Put your files in the httpdocs or any folder you want, and just point to the public folder when setting your document_root in your hosting settings.

1 like
PaulMaxOS's avatar

Well, if you don’t want the hassle of setting up everything on your own I would recommend having a look at Laravel Forge. It will take care of everything that’s needed and you just need to connect your repo to it in order to have deployments on certain git actions. If you want even better process for CD you might want to have a look at Laravel Envoyer.

Otherwise you need to setup the LAMP or LEMP stack on your own.

A guide for this might be this: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04

Another option would be to go with AWS Lightsail which comes with a LAMP Stack starterkit from Bitnami. Personally I’m not really happy with it but it gives at least a starting point. Lightsail offers several other starterkits by the way.

1 like

Please or to participate in this conversation.