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

pierre4854's avatar

Laravel Deployment

Hi guys,

So, I'm going to tell my questions because I'm definitely done about what I've found on the web. I just want to know how to deploy Laravel from Local (windows) to a webserver (linux) ? According to the web, I can update my Apache virtual hosts or move index.php / .htaccess on root folder and change boostrap line into index.php But I don't know which solution is better and "properly" to deploy Laravel ?

Secondly, I've tried my second option. So, I can go on my homepage but when I want to navigate on my website, links are broken and I'm getting 404 Not Found. Did I miss something ?

Thanks in advance,

0 likes
7 replies
extjac's avatar

You can FTP Laravel to your server and then point the domain to the /public folder.

I like to use github instead of FTP

pierre4854's avatar

I've seen this answer many times on many forums but I wanted to know if there is a way to deploy without move public folder or anything else ?

Mittensoff's avatar

As far as your navigation problems go, check if you wrote "/" before links, may cause a problem when using relative locators.

jlrdw's avatar

I wanted to know if there is a way to deploy without move public folder or anything else ?

Install laravel correctly, also has to do with security!

pierre4854's avatar

@Mittensoff I checked it and I removed it but problem still present, even if I made a php artisan cache:clear

@jlrdw Yes ok, but even if I don't touch to Laravel structure, my virtual host accept to go on homepage but refuse to go on another page and give me a 404 ...

Mittensoff's avatar

So it only goes to your home page and can't get to any other view?

Can you screenshot your resources/views folder structure?

  1. To check if you have your Web server configured correctly, upload a brand new Laravel project to your Web server public folder and test it with a +1 page apart from the homepage.

  2. If the Web server's configured correctly, then I'd re-check Controller methods, what view they return, then go check routes' web.php and see if it's okay.

  3. Check your html code, to see if you linked correctly in your <a> tags.

Please or to participate in this conversation.