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

mhdd's avatar
Level 9

upload laravel 5.2 to a VPS

hey guys. i have a VPS with CentOS 7. what is the best way to deploy laravel project to that server. i know there are so many tools & websites like forge that can handle this so easily. but i want to learn & understand how to do this old school way.

Also i know there are so many tutorials with bunch of tips & tricks to handle this like change some library URLs, change laravel core files like paths & etc.

I really dont think thats the best way to handle that situation.

& of course i really don't understand why Jeffrey way & Taylor Otwell didn't create anything to handle this situation, on laracasts & laravel official documents. i know that people can upload their projects with forge so easy but how about people like me that want to understand the process.

thanks guys

0 likes
8 replies
zachleigh's avatar

Use git. Host your site code somewhere like Github or Bitbucket, then simply pull the repo into your server from the online repo. I maintain several sites without anything like Forge and this is what I do. Forge makes it easier, but this way honestly isnt too bad.

1 like
Prullenbak's avatar

Git is certainly the way to go.

But if you don't want (or don't know how) to do that, you can also upload everything but the vendor folder, update your env file and you're basically good to go. However this can become a pain when you need to update something. So yeah, use git :)

1 like
mhdd's avatar
Level 9

Thanks for your replys guys.

@zachleigh i was thinking about git. seems that should be a good solutions. when u was trying to deploy your project did you change your document root of your web server & you used another solution. would you please describe how did you do that?

zachleigh's avatar

You shouldn't have to do anything. I use Apache so I simply set up a virtual host pointing to the project and thats it. Which host are you using?

1 like
mhdd's avatar
Level 9

i have a VPS with CentOS 7. so you created a virtual host & point it to your laravel directory right? is there any other step that i should do?

Prullenbak's avatar

Digitalocean has a lot of great guides. Even for laravel specific. It's great.

I (having never set up a server from scratch before in my life) was hosting a laravel application in a couple of hours.

Please or to participate in this conversation.