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

sos99's avatar
Level 7

real world deploy (like ubuntu) recommend folders premission

Hello In real world production service on Linux (for example 18.04 LTS with nginx) ,

  1. What is the folder permission for Laravel ?

  2. In same laravel project, permission will be different between the folders? (storage ,public,app and so on) ?

Thank You

0 likes
3 replies
D9705996's avatar
D9705996
Best Answer
Level 51

The equired permissions are covered in the documentation.

https://laravel.com/docs/5.8/installation#configuration

I would setup the owner of the files/directories as root and your webserver as the group and set file permissions to 0640 and directories as 0750

E.g. from your project root

chown root.apache * -R 
find -type d -exec chmod 750 {} \;
find -type f -exdc chmod 640 {} \;

This will setup the majority of thd permission but then for the directories that need webserver write like storage

chmod 660 storage -R

You just need to change user/groups to match your engine setup

D9705996's avatar

@SOS99 - I change the owner to root so only the root user has write access as your application code should not be able to be changed by the user running the web server. I choose root as I have this account heavily locked down and only accessible via sudo so all commands are logged.

Thd larzvel documentation gives good high level setup requirements but would impractical or even impossible to document every possible setup and is assumed that you have sufficient webserver admin skills to be able to do this. There is also the option of laravel forge.

If you think the docs need further details you could always create a pull request on thd github repository

https://github.com/laravel/docs

Please or to participate in this conversation.