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

felxio's avatar

Best practice to deploy

Hi guys,

I have host domain and a subdomain (with FTP parameters) given by a friend and I would like to know how to deploy laravel to that subdomain.

Regadrs, Felix

0 likes
5 replies
jrean's avatar

@felxio There is not a single way to go..

One could be to upload your project with FTP, then run a composer install (never update on production), don't forget to update your .env file and "at least" set the debug option to false and the environment to production.

Check the storage folder permissions, run a composer dumpautoload -o, run a php artisan optimize and you should be ready to go :)

1 like
felxio's avatar

@jrean, If I understand, I should follow these steps:

1 - in .env file: I have to set up the debug option to false and environment to production

2 - upload my project with FTP

3 - check the folder storage (after or before uploading on the server)

4 - run composer dumpautoload -o (Where should I run it, on the server? If yes how can I do that?)

5 - run php artisan optimize same interrogation as before.

Thanks.

jrean's avatar

@felxio

1 - yes

2 - yes

3 - yes, once you have uploaded your project (you should already have checked that on your dev env)

4 - I think I understand you don't use command line or don't have access to command line for your server? It may be hard to maintain your project. Anyway, my advise would be to ask you to not upload the vendor directory and to run the composer install command. It will install all required dependencies listed in your composer.json. Then run a composer dumpautoload -o command.

4.2 - If you don't know how to run shell commands or can't, so just upload out of the box your Laravel project.

5 - same as 4

1 like
felxio's avatar

@jrean Please, may you tell me how to run those command on my subdomain? I did some researches but I still cannot figure it out. Thank you in advance.

skylerkatz's avatar

hi @felxio,

Do you have access to SSH into the subdomain on the server? If so, that is where you would run the composer commands.

Please or to participate in this conversation.